1
0
mirror of https://github.com/anope/anope.git synced 2026-06-28 06:16:37 +02:00

Use C++11's explicit override feature if available

This commit is contained in:
Adam
2012-02-18 15:04:26 -05:00
parent 41e8d27602
commit ee5cd8493e
201 changed files with 995 additions and 1003 deletions
+32 -32
View File
@@ -43,40 +43,40 @@ IRCDVar myIrcd[] = {
class PlexusProto : public IRCDProto
{
void SendGlobopsInternal(const BotInfo *source, const Anope::string &buf)
void SendGlobopsInternal(const BotInfo *source, const Anope::string &buf) anope_override
{
UplinkSocket::Message(source ? source->GetUID() : Me->GetSID()) << "OPERWALL :" << buf;
}
void SendSQLine(User *, const XLine *x)
void SendSQLine(User *, const XLine *x) anope_override
{
UplinkSocket::Message(Me->GetSID()) << "RESV * " << x->Mask << " :" << x->Reason;
}
void SendSGLineDel(const XLine *x)
void SendSGLineDel(const XLine *x) anope_override
{
BotInfo *bi = findbot(Config->OperServ);
UplinkSocket::Message(bi ? bi->GetUID() : Config->OperServ) << "UNXLINE * " << x->Mask;
}
void SendSGLine(User *, const XLine *x)
void SendSGLine(User *, const XLine *x) anope_override
{
BotInfo *bi = findbot(Config->OperServ);
UplinkSocket::Message(bi ? bi->GetUID() : Config->OperServ) << "XLINE * " << x->Mask << " 0 :" << x->Reason;
}
void SendAkillDel(const XLine *x)
void SendAkillDel(const XLine *x) anope_override
{
BotInfo *bi = findbot(Config->OperServ);
UplinkSocket::Message(bi ? bi->GetUID() : Config->OperServ) << "UNKLINE * " << x->GetUser() << " " << x->GetHost();
}
void SendSQLineDel(const XLine *x)
void SendSQLineDel(const XLine *x) anope_override
{
UplinkSocket::Message(Me->GetSID()) << "UNRESV * " << x->Mask;
}
void SendJoin(User *user, Channel *c, const ChannelStatus *status)
void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override
{
UplinkSocket::Message(Me->GetSID()) << "SJOIN " << c->creation_time << " " << c->name << " +" << c->GetModes(true, true) << " :" << user->GetUID();
if (status)
@@ -97,7 +97,7 @@ class PlexusProto : public IRCDProto
}
}
void SendAkill(User *, const XLine *x)
void SendAkill(User *, const XLine *x) anope_override
{
// Calculate the time left before this would expire, capping it at 2 days
time_t timeleft = x->Expires - Anope::CurTime;
@@ -107,12 +107,12 @@ class PlexusProto : public IRCDProto
UplinkSocket::Message(bi ? bi->GetUID() : Config->OperServ) << "KLINE * " << timeleft << " " << x->GetUser() << " " << x->GetHost() << " :" << x->Reason;
}
void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf)
void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf) anope_override
{
UplinkSocket::Message(source ? source->GetUID() : Me->GetSID()) << "KILL " << user->GetUID() << " :" << buf;
}
void SendServer(const Server *server)
void SendServer(const Server *server) anope_override
{
if (server == Me)
UplinkSocket::Message() << "SERVER " << server->GetName() << " " << server->GetHops() << " :" << server->GetDescription();
@@ -120,12 +120,12 @@ class PlexusProto : public IRCDProto
UplinkSocket::Message(Me->GetSID()) << "SID " << server->GetName() << " " << server->GetHops() << " " << server->GetSID() << " :" << server->GetDescription();
}
void SendForceNickChange(const User *u, const Anope::string &newnick, time_t when)
void SendForceNickChange(const User *u, const Anope::string &newnick, time_t when) anope_override
{
UplinkSocket::Message(Me->GetSID()) << "ENCAP " << u->server->GetName() << " SVSNICK " << u->GetUID() << " " << u->timestamp << " " << newnick << " " << when;
}
void SendVhostDel(User *u)
void SendVhostDel(User *u) anope_override
{
BotInfo *bi = findbot(Config->HostServ);
if (u->HasMode(UMODE_CLOAK))
@@ -134,14 +134,14 @@ class PlexusProto : public IRCDProto
this->SendVhost(u, u->GetIdent(), u->chost);
}
void SendVhost(User *u, const Anope::string &ident, const Anope::string &host)
void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) anope_override
{
if (!ident.empty())
UplinkSocket::Message(Me->GetSID()) << "ENCAP * CHGIDENT " << u->GetUID() << " " << ident;
UplinkSocket::Message(Me->GetSID()) << "ENCAP * CHGHOST " << u->GetUID() << " " << host;
}
void SendConnect()
void SendConnect() anope_override
{
UplinkSocket::Message() << "PASS " << Config->Uplinks[CurrentUplink]->password << " TS 6 :" << Me->GetSID();
/* CAPAB
@@ -178,13 +178,13 @@ class PlexusProto : public IRCDProto
UplinkSocket::Message() << "SVINFO 6 5 0 :" << Anope::CurTime;
}
void SendClientIntroduction(const User *u)
void SendClientIntroduction(const User *u) anope_override
{
Anope::string modes = "+" + u->GetModes();
UplinkSocket::Message(Me->GetSID()) << "UID " << u->nick << " 1 " << u->timestamp << " " << modes << " " << u->GetIdent() << " " << u->host << " 255.255.255.255 " << u->GetUID() << " 0 " << u->host << " :" << u->realname;
}
void SendPartInternal(const BotInfo *bi, const Channel *chan, const Anope::string &buf)
void SendPartInternal(const BotInfo *bi, const Channel *chan, const Anope::string &buf) anope_override
{
if (!buf.empty())
UplinkSocket::Message(bi->GetUID()) << "PART " << chan->name << " :" << buf;
@@ -192,17 +192,17 @@ class PlexusProto : public IRCDProto
UplinkSocket::Message(bi->GetUID()) << "PART " << chan->name;
}
void SendModeInternal(const BotInfo *bi, const Channel *dest, const Anope::string &buf)
void SendModeInternal(const BotInfo *bi, const Channel *dest, const Anope::string &buf) anope_override
{
UplinkSocket::Message(bi ? bi->GetUID() : Me->GetSID()) << "MODE " << dest->name << " " << buf;
}
void SendModeInternal(const BotInfo *bi, const User *u, const Anope::string &buf)
void SendModeInternal(const BotInfo *bi, const User *u, const Anope::string &buf) anope_override
{
UplinkSocket::Message(bi ? bi->GetUID() : Me->GetSID()) << "ENCAP * SVSMODE " << u->GetUID() << " " << u->timestamp << " " << buf;
}
void SendKickInternal(const BotInfo *bi, const Channel *chan, const User *user, const Anope::string &buf)
void SendKickInternal(const BotInfo *bi, const Channel *chan, const User *user, const Anope::string &buf) anope_override
{
if (!buf.empty())
UplinkSocket::Message(bi->GetUID()) << "KICK " << chan->name << " " << user->GetUID() << " :" << buf;
@@ -211,13 +211,13 @@ class PlexusProto : public IRCDProto
}
/* INVITE */
void SendInvite(BotInfo *source, const Anope::string &chan, const Anope::string &nick)
void SendInvite(const BotInfo *source, const Anope::string &chan, const Anope::string &nick) anope_override
{
User *u = finduser(nick);
UplinkSocket::Message(source->GetUID()) << "INVITE " << (u ? u->GetUID() : nick) << " " << chan;
}
void SendLogin(User *u)
void SendLogin(User *u) anope_override
{
if (!u->Account())
return;
@@ -225,17 +225,17 @@ class PlexusProto : public IRCDProto
UplinkSocket::Message(Me->GetSID()) << "ENCAP * SU " << u->GetUID() << " " << u->Account()->display;
}
void SendLogout(User *u)
void SendLogout(User *u) anope_override
{
UplinkSocket::Message(Me->GetSID()) << "ENCAP * SU " << u->GetUID();
}
void SendTopic(BotInfo *bi, Channel *c)
void SendTopic(BotInfo *bi, Channel *c) anope_override
{
UplinkSocket::Message(bi->GetUID()) << "ENCAP * TOPIC " << c->name << " " << c->topic_setter << " " << c->topic_time + 1 << " :" << c->topic;
}
void SendChannel(Channel *c)
void SendChannel(Channel *c) anope_override
{
Anope::string modes = c->GetModes(true, true);
if (modes.empty())
@@ -251,7 +251,7 @@ class PlexusIRCdMessage : public IRCdMessage
* params[0] = ts
* params[1] = channel
*/
bool OnJoin(const Anope::string &source, const std::vector<Anope::string> &params)
bool OnJoin(const Anope::string &source, const std::vector<Anope::string> &params) anope_override
{
if (params.size() < 2)
return IRCdMessage::OnJoin(source, params);
@@ -259,7 +259,7 @@ class PlexusIRCdMessage : public IRCdMessage
return true;
}
bool OnMode(const Anope::string &source, const std::vector<Anope::string> &params)
bool OnMode(const Anope::string &source, const std::vector<Anope::string> &params) anope_override
{
if (params.size() < 2)
return true;
@@ -286,7 +286,7 @@ class PlexusIRCdMessage : public IRCdMessage
params[9] = realhost
params[10] = info
*/
bool OnUID(const Anope::string &source, const std::vector<Anope::string> &params)
bool OnUID(const Anope::string &source, const std::vector<Anope::string> &params) anope_override
{
/* An IP of 0 means the user is spoofed */
Anope::string ip = params[6];
@@ -299,13 +299,13 @@ class PlexusIRCdMessage : public IRCdMessage
return true;
}
bool OnNick(const Anope::string &source, const std::vector<Anope::string> &params)
bool OnNick(const Anope::string &source, const std::vector<Anope::string> &params) anope_override
{
do_nick(source, params[0], "", "", "", "", Anope::string(params[1]).is_pos_number_only() ? convertTo<time_t>(params[1]) : 0, "", "", "", "");
return true;
}
bool OnServer(const Anope::string &source, const std::vector<Anope::string> &params)
bool OnServer(const Anope::string &source, const std::vector<Anope::string> &params) anope_override
{
if (params[1].equals_cs("1"))
do_server(source, params[0], Anope::string(params[1]).is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0, params[2], TS6UPLINK);
@@ -328,7 +328,7 @@ class PlexusIRCdMessage : public IRCdMessage
params[9] = realhost
params[10] = info
*/
bool OnTopic(const Anope::string &source, const std::vector<Anope::string> &params)
bool OnTopic(const Anope::string &source, const std::vector<Anope::string> &params) anope_override
{
Channel *c = findchan(params[0]);
if (!c)
@@ -345,7 +345,7 @@ class PlexusIRCdMessage : public IRCdMessage
return true;
}
bool OnSJoin(const Anope::string &source, const std::vector<Anope::string> &params)
bool OnSJoin(const Anope::string &source, const std::vector<Anope::string> &params) anope_override
{
Channel *c = findchan(params[1]);
time_t ts = Anope::string(params[0]).is_pos_number_only() ? convertTo<time_t>(params[0]) : 0;
@@ -683,7 +683,7 @@ class ProtoPlexus : public Module
pmodule_ircd_message(NULL);
}
void OnServerSync(Server *s)
void OnServerSync(Server *s) anope_override
{
if (nickserv)
for (Anope::insensitive_map<User *>::iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it)