diff options
Diffstat (limited to 'modules/protocol/hybrid.cpp')
-rw-r--r-- | modules/protocol/hybrid.cpp | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp index 05e589a08..5046030ba 100644 --- a/modules/protocol/hybrid.cpp +++ b/modules/protocol/hybrid.cpp @@ -17,7 +17,7 @@ static bool UseSVSAccount = false; // Temporary backwards compatibility hack un class HybridProto : public IRCDProto { - void SendSVSKillInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override + void SendSVSKillInternal(const MessageSource &source, User *u, const Anope::string &buf) override { IRCDProto::SendSVSKillInternal(source, u, buf); u->KillInternal(source, buf); @@ -40,42 +40,42 @@ class HybridProto : public IRCDProto MaxModes = 6; } - void SendInvite(const MessageSource &source, const Channel *c, User *u) anope_override + void SendInvite(const MessageSource &source, const Channel *c, User *u) override { UplinkSocket::Message(source) << "INVITE " << u->GetUID() << " " << c->name << " " << c->creation_time; } - void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "NOTICE $$" << dest->GetName() << " :" << msg; } - void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "PRIVMSG $$" << dest->GetName() << " :" << msg; } - void SendSQLine(User *, const XLine *x) anope_override + void SendSQLine(User *, const XLine *x) override { UplinkSocket::Message(Me) << "RESV * " << (x->expires ? x->expires - Anope::CurTime : 0) << " " << x->mask << " :" << x->reason; } - void SendSGLineDel(const XLine *x) anope_override + void SendSGLineDel(const XLine *x) override { UplinkSocket::Message(Me) << "UNXLINE * " << x->mask; } - void SendSGLine(User *, const XLine *x) anope_override + void SendSGLine(User *, const XLine *x) override { UplinkSocket::Message(Me) << "XLINE * " << x->mask << " " << (x->expires ? x->expires - Anope::CurTime : 0) << " :" << x->GetReason(); } - void SendSZLineDel(const XLine *x) anope_override + void SendSZLineDel(const XLine *x) override { UplinkSocket::Message(Me) << "UNDLINE * " << x->GetHost(); } - void SendSZLine(User *, const XLine *x) anope_override + void SendSZLine(User *, const XLine *x) override { /* Calculate the time left before this would expire, capping it at 2 days */ time_t timeleft = x->expires - Anope::CurTime; @@ -86,7 +86,7 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Me) << "DLINE * " << timeleft << " " << x->GetHost() << " :" << x->GetReason(); } - void SendAkillDel(const XLine *x) anope_override + void SendAkillDel(const XLine *x) override { if (x->IsRegex() || x->HasNickOrReal()) return; @@ -94,12 +94,12 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Me) << "UNKLINE * " << x->GetUser() << " " << x->GetHost(); } - void SendSQLineDel(const XLine *x) anope_override + void SendSQLineDel(const XLine *x) override { UplinkSocket::Message(Me) << "UNRESV * " << x->mask; } - void SendJoin(User *u, Channel *c, const ChannelStatus *status) anope_override + void SendJoin(User *u, Channel *c, const ChannelStatus *status) override { UplinkSocket::Message(Me) << "SJOIN " << c->creation_time << " " << c->name << " +" << c->GetModes(true, true) << " :" << u->GetUID(); @@ -130,7 +130,7 @@ class HybridProto : public IRCDProto } } - void SendAkill(User *u, XLine *x) anope_override + void SendAkill(User *u, XLine *x) override { if (x->IsRegex() || x->HasNickOrReal()) { @@ -171,7 +171,7 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Me) << "KLINE * " << timeleft << " " << x->GetUser() << " " << x->GetHost() << " :" << x->GetReason(); } - void SendServer(const Server *server) anope_override + void SendServer(const Server *server) override { if (server == Me) UplinkSocket::Message() << "SERVER " << server->GetName() << " " << server->GetHops() + 1 << " " << server->GetSID() << " +" << " :" << server->GetDescription(); @@ -179,7 +179,7 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Me) << "SID " << server->GetName() << " " << server->GetHops() + 1 << " " << server->GetSID() << " +" << " :" << server->GetDescription(); } - void SendConnect() anope_override + void SendConnect() override { UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password; @@ -197,7 +197,7 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Me) << "SVINFO 6 6 0 :" << Anope::CurTime; } - void SendClientIntroduction(User *u) anope_override + void SendClientIntroduction(User *u) override { Anope::string modes = "+" + u->GetModes(); @@ -205,17 +205,17 @@ class HybridProto : public IRCDProto << u->host << " " << u->host << " 0.0.0.0 " << u->GetUID() << " * :" << u->realname; } - void SendEOB() anope_override + void SendEOB() override { UplinkSocket::Message(Me) << "EOB"; } - void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override + void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) override { UplinkSocket::Message(source) << "SVSMODE " << u->GetUID() << " " << u->timestamp << " " << buf; } - void SendLogin(User *u, NickAlias *na) anope_override + void SendLogin(User *u, NickAlias *na) override { if (UseSVSAccount == false) IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %s", na->nc->display.c_str()); @@ -223,7 +223,7 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Me) << "SVSACCOUNT " << u->GetUID() << " " << u->timestamp << " " << na->nc->display; } - void SendLogout(User *u) anope_override + void SendLogout(User *u) override { if (UseSVSAccount == false) IRCD->SendMode(Config->GetClient("NickServ"), u, "+d *"); @@ -231,28 +231,28 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Me) << "SVSACCOUNT " << u->GetUID() << " " << u->timestamp << " *"; } - void SendChannel(Channel *c) anope_override + void SendChannel(Channel *c) override { Anope::string modes = "+" + c->GetModes(true, true); UplinkSocket::Message(Me) << "SJOIN " << c->creation_time << " " << c->name << " " << modes << " :"; } - void SendTopic(const MessageSource &source, Channel *c) anope_override + void SendTopic(const MessageSource &source, Channel *c) override { UplinkSocket::Message(source) << "TBURST " << c->creation_time << " " << c->name << " " << c->topic_ts << " " << c->topic_setter << " :" << c->topic; } - void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) anope_override + void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) override { UplinkSocket::Message(Me) << "SVSNICK " << u->GetUID() << " " << u->timestamp << " " << newnick << " " << when; } - void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &) anope_override + void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &) override { UplinkSocket::Message(source) << "SVSJOIN " << u->GetUID() << " " << chan; } - void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) anope_override + void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) override { if (!param.empty()) UplinkSocket::Message(source) << "SVSPART " << u->GetUID() << " " << chan << " :" << param; @@ -260,34 +260,34 @@ class HybridProto : public IRCDProto UplinkSocket::Message(source) << "SVSPART " << u->GetUID() << " " << chan; } - void SendSVSHold(const Anope::string &nick, time_t t) anope_override + void SendSVSHold(const Anope::string &nick, time_t t) override { XLine x(nick, Me->GetName(), Anope::CurTime + t, "Being held for registered user"); this->SendSQLine(NULL, &x); } - void SendSVSHoldDel(const Anope::string &nick) anope_override + void SendSVSHoldDel(const Anope::string &nick) override { XLine x(nick); this->SendSQLineDel(&x); } - void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) anope_override + void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) override { UplinkSocket::Message(Me) << "SVSHOST " << u->GetUID() << " " << u->timestamp << " " << host; } - void SendVhostDel(User *u) anope_override + void SendVhostDel(User *u) override { UplinkSocket::Message(Me) << "SVSHOST " << u->GetUID() << " " << u->timestamp << " " << u->host; } - bool IsExtbanValid(const Anope::string &mask) anope_override + bool IsExtbanValid(const Anope::string &mask) override { return mask.length() >= 4 && mask[0] == '$' && mask[2] == ':'; } - bool IsIdentValid(const Anope::string &ident) anope_override + bool IsIdentValid(const Anope::string &ident) override { if (ident.empty() || ident.length() > Config->GetBlock("networkinfo")->Get<unsigned>("userlen")) return false; @@ -331,7 +331,7 @@ struct IRCDMessageBMask : IRCDMessage /* 0 1 2 3 */ /* :0MC BMASK 1350157102 #channel b :*!*@*.test.com */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override { Channel *c = Channel::Find(params[1]); ChannelMode *mode = ModeManager::FindChannelModeByChar(params[2][0]); @@ -353,7 +353,7 @@ struct IRCDMessageCapab : Message::Capab /* 0 */ /* CAPAB :TBURST EOB MLOCK */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override { spacesepstream sep(params[0]); Anope::string capab; @@ -368,7 +368,7 @@ struct IRCDMessageCapab : Message::Capab ModeManager::AddChannelMode(new ChannelModeStatus("OWNER", 'q', '~', 4)); } - Message::Capab::Run(source, params); + Message::Capab::Run(source, params, tags); } }; @@ -376,7 +376,7 @@ struct IRCDMessageEOB : IRCDMessage { IRCDMessageEOB(Module *creator) : IRCDMessage(creator, "EOB", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override { source.GetServer()->Sync(true); } @@ -386,7 +386,7 @@ struct IRCDMessageJoin : Message::Join { IRCDMessageJoin(Module *creator) : Message::Join(creator, "JOIN") { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override { if (params.size() < 2) return; @@ -394,7 +394,7 @@ struct IRCDMessageJoin : Message::Join std::vector<Anope::string> p = params; p.erase(p.begin()); - Message::Join::Run(source, p); + Message::Join::Run(source, p, tags); } }; @@ -404,7 +404,7 @@ struct IRCDMessageMLock : IRCDMessage /* 0 1 2 3 */ /* :0MC MLOCK 1350157102 #channel 1350158923 :nt */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override { Channel *c = Channel::Find(params[1]); @@ -429,7 +429,7 @@ struct IRCDMessageNick : IRCDMessage /* 0 1 */ /* :0MCAAAAAB NICK newnick 1350157102 */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override { source.GetUser()->ChangeNick(params[0], convertTo<time_t>(params[1])); } @@ -441,7 +441,7 @@ struct IRCDMessagePass : IRCDMessage /* 0 */ /* PASS password */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override { if (params.size() == 4) UplinkSID = params[3]; @@ -452,7 +452,7 @@ struct IRCDMessagePong : IRCDMessage { IRCDMessagePong(Module *creator) : IRCDMessage(creator, "PONG", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override { source.GetServer()->Sync(false); } @@ -464,7 +464,7 @@ struct IRCDMessageServer : IRCDMessage /* 0 1 2 3 4 */ /* SERVER hades.arpa 1 4XY + :ircd-hybrid test server */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override { /* Servers other than our immediate uplink are introduced via SID */ if (params[1] != "1") @@ -488,7 +488,7 @@ struct IRCDMessageSID : IRCDMessage /* 0 1 2 3 4 */ /* :0MC SID hades.arpa 2 4XY + :ircd-hybrid test server */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override { unsigned int hops = params[1].is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0; new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params.back(), params[2]); @@ -503,7 +503,7 @@ struct IRCDMessageSJoin : IRCDMessage /* 0 1 2 3 */ /* :0MC SJOIN 1654877335 #nether +nt :@0MCAAAAAB +0MCAAAAAC */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override { Anope::string modes; @@ -550,7 +550,7 @@ struct IRCDMessageSVSMode : IRCDMessage /* 0 1 2 */ /* :0MC SVSMODE 0MCAAAAAB 1350157102 +r */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override { User *u = User::Find(params[0]); @@ -570,7 +570,7 @@ struct IRCDMessageTBurst : IRCDMessage /* 0 1 2 3 4 */ /* :0MC TBURST 1654867975 #nether 1654877335 Steve!~steve@the.mines :Join the ghast nation */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override { Anope::string setter; sepstream(params[3], '!').GetToken(setter, 0); @@ -588,7 +588,7 @@ struct IRCDMessageTMode : IRCDMessage /* 0 1 2 */ /* :0MC TMODE 1654867975 #nether +ntR */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override { time_t ts = 0; @@ -615,7 +615,7 @@ struct IRCDMessageUID : IRCDMessage /* 0 1 2 3 4 5 6 7 8 9 10 */ /* :0MC UID Steve 1 1350157102 +oi ~steve virtual.host real.host 10.0.0.1 0MCAAAAAB Steve :Mining all the time */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override { NickAlias *na = NULL; @@ -635,7 +635,7 @@ struct IRCDMessageCertFP: IRCDMessage /* 0 */ /* :0MCAAAAAB CERTFP 4C62287BA6776A89CD4F8FF10A62FFB35E79319F51AF6C62C674984974FCCB1D */ - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override { User *u = source.GetUser(); @@ -762,17 +762,17 @@ class ProtoHybrid : public Module this->AddModes(); } - void OnUserNickChange(User *u, const Anope::string &) anope_override + void OnUserNickChange(User *u, const Anope::string &) override { u->RemoveModeInternal(Me, ModeManager::FindUserModeByName("REGISTERED")); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock"); } - void OnChannelSync(Channel *c) anope_override + void OnChannelSync(Channel *c) override { if (!c->ci) return; @@ -785,13 +785,13 @@ class ProtoHybrid : public Module } } - void OnDelChan(ChannelInfo *ci) anope_override + void OnDelChan(ChannelInfo *ci) override { if (use_server_side_mlock && ci->c && Servers::Capab.count("MLOCK")) UplinkSocket::Message(Me) << "MLOCK " << ci->c->creation_time << " " << ci->name << " " << Anope::CurTime << " :"; } - EventReturn OnMLock(ChannelInfo *ci, ModeLock *lock) anope_override + EventReturn OnMLock(ChannelInfo *ci, ModeLock *lock) override { ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks"); ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name); @@ -804,7 +804,7 @@ class ProtoHybrid : public Module return EVENT_CONTINUE; } - EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock) anope_override + EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock) override { ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks"); ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name); |