diff options
-rw-r--r-- | include/extern.h | 1 | ||||
-rw-r--r-- | modules/protocol/bahamut.cpp | 2 | ||||
-rw-r--r-- | modules/protocol/inspircd11.cpp | 4 | ||||
-rw-r--r-- | modules/protocol/inspircd12.cpp | 4 | ||||
-rw-r--r-- | modules/protocol/inspircd20.cpp | 4 | ||||
-rw-r--r-- | modules/protocol/ratbox.cpp | 2 | ||||
-rw-r--r-- | modules/protocol/unreal32.cpp | 2 | ||||
-rw-r--r-- | src/init.cpp | 2 | ||||
-rw-r--r-- | src/mail.cpp | 2 | ||||
-rw-r--r-- | src/messages.cpp | 13 | ||||
-rw-r--r-- | src/send.cpp | 4 |
11 files changed, 23 insertions, 17 deletions
diff --git a/include/extern.h b/include/extern.h index 3b20bba8d..fe6fe7546 100644 --- a/include/extern.h +++ b/include/extern.h @@ -220,6 +220,7 @@ E bool m_stats(const Anope::string &source, const std::vector<Anope::string> &); E int m_whois(const Anope::string &source, const Anope::string &who); E bool m_time(const Anope::string &source, const std::vector<Anope::string> &); E bool m_version(const Anope::string &source, const std::vector<Anope::string> &); +E void init_core_messages(); /**** misc.c ****/ diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp index 268b33eda..70dffb8ce 100644 --- a/modules/protocol/bahamut.cpp +++ b/modules/protocol/bahamut.cpp @@ -257,7 +257,7 @@ class BahamutIRCdProto : public IRCDProto void SendClientIntroduction(const User *u, const Anope::string &modes) { EnforceQlinedNick(u->nick, Config->s_BotServ); - send_cmd("", "NICK %s 1 %ld %s %s %s %s 0 0 :%s", u->nick.c_str(), u->timestamp, modes.c_str(), u->GetIdent().c_str(), u->host.c_str(), u->server->GetName().c_str(), u->realname.c_str()); + send_cmd("", "NICK %s 1 %ld %s %s %s %s 0 0 :%s", u->nick.c_str(), static_cast<long>(u->timestamp), modes.c_str(), u->GetIdent().c_str(), u->host.c_str(), u->server->GetName().c_str(), u->realname.c_str()); } /* SVSMODE +d */ diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp index cce1ce09d..7d1d456ac 100644 --- a/modules/protocol/inspircd11.cpp +++ b/modules/protocol/inspircd11.cpp @@ -144,7 +144,7 @@ class InspIRCdProto : public IRCDProto void SendClientIntroduction(const User *u, const Anope::string &modes) { - send_cmd(Config->ServerName, "NICK %ld %s %s %s %s %s 0.0.0.0 :%s", u->timestamp, u->nick.c_str(), u->host.c_str(), u->host.c_str(), u->GetIdent().c_str(), modes.c_str(), u->realname.c_str()); + send_cmd(Config->ServerName, "NICK %ld %s %s %s %s %s 0.0.0.0 :%s", static_cast<long>(u->timestamp), u->nick.c_str(), u->host.c_str(), u->host.c_str(), u->GetIdent().c_str(), modes.c_str(), u->realname.c_str()); send_cmd(u->nick, "OPERTYPE Service"); } @@ -275,7 +275,7 @@ class InspIRCdProto : public IRCDProto void SendBOB() { - send_cmd("", "BURST %ld", Anope::CurTime); + send_cmd("", "BURST %ld", static_cast<long>(Anope::CurTime)); } void SendEOB() diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp index f45b58dce..425b85517 100644 --- a/modules/protocol/inspircd12.cpp +++ b/modules/protocol/inspircd12.cpp @@ -145,7 +145,7 @@ class InspIRCdProto : public IRCDProto void SendClientIntroduction(const User *u, const Anope::string &modes) { - send_cmd(TS6SID, "UID %s %ld %s %s %s %s 0.0.0.0 %ld %s :%s", u->GetUID().c_str(), u->timestamp, u->nick.c_str(), u->host.c_str(), u->host.c_str(), u->GetIdent().c_str(), u->my_signon, modes.c_str(), u->realname.c_str()); + send_cmd(TS6SID, "UID %s %ld %s %s %s %s 0.0.0.0 %ld %s :%s", u->GetUID().c_str(), static_cast<long>(u->timestamp), u->nick.c_str(), u->host.c_str(), u->host.c_str(), u->GetIdent().c_str(), static_cast<long>(u->my_signon), modes.c_str(), u->realname.c_str()); } void SendKickInternal(const BotInfo *source, const Channel *chan, const User *user, const Anope::string &buf) @@ -270,7 +270,7 @@ class InspIRCdProto : public IRCDProto void SendBOB() { - send_cmd(TS6SID, "BURST %ld", Anope::CurTime); + send_cmd(TS6SID, "BURST %ld", static_cast<long>(Anope::CurTime)); } void SendEOB() diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index 4f7d8353f..b2d064dfd 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -143,7 +143,7 @@ class InspIRCdProto : public IRCDProto void SendClientIntroduction(const User *u, const Anope::string &modes) { - send_cmd(TS6SID, "UID %s %ld %s %s %s %s 0.0.0.0 %ld %s :%s", u->GetUID().c_str(), u->timestamp, u->nick.c_str(), u->host.c_str(), u->host.c_str(), u->GetIdent().c_str(), u->my_signon, modes.c_str(), u->realname.c_str()); + send_cmd(TS6SID, "UID %s %ld %s %s %s %s 0.0.0.0 %ld %s :%s", u->GetUID().c_str(), static_cast<long>(u->timestamp), u->nick.c_str(), u->host.c_str(), u->host.c_str(), u->GetIdent().c_str(), static_cast<long>(u->my_signon), modes.c_str(), u->realname.c_str()); } void SendKickInternal(const BotInfo *source, const Channel *chan, const User *user, const Anope::string &buf) @@ -271,7 +271,7 @@ class InspIRCdProto : public IRCDProto void SendBOB() { - send_cmd(TS6SID, "BURST %ld", Anope::CurTime); + send_cmd(TS6SID, "BURST %ld", static_cast<long>(Anope::CurTime)); } void SendEOB() diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp index 285c308fb..6882954fc 100644 --- a/modules/protocol/ratbox.cpp +++ b/modules/protocol/ratbox.cpp @@ -174,7 +174,7 @@ class RatboxProto : public IRCDProto void SendClientIntroduction(const User *u, const Anope::string &modes) { EnforceQlinedNick(u->nick, ""); - send_cmd(TS6SID, "UID %s 1 %ld %s %s %s 0 %s :%s", u->nick.c_str(), u->timestamp, modes.c_str(), u->GetIdent().c_str(), u->host.c_str(), u->GetUID().c_str(), u->realname.c_str()); + send_cmd(TS6SID, "UID %s 1 %ld %s %s %s 0 %s :%s", u->nick.c_str(), static_cast<long>(u->timestamp), modes.c_str(), u->GetIdent().c_str(), u->host.c_str(), u->GetUID().c_str(), u->realname.c_str()); } void SendPartInternal(const BotInfo *bi, const Channel *chan, const Anope::string &buf) diff --git a/modules/protocol/unreal32.cpp b/modules/protocol/unreal32.cpp index 9307d3fa2..8c86dae0c 100644 --- a/modules/protocol/unreal32.cpp +++ b/modules/protocol/unreal32.cpp @@ -165,7 +165,7 @@ class UnrealIRCdProto : public IRCDProto void SendClientIntroduction(const User *u, const Anope::string &modes) { EnforceQlinedNick(u->nick, Config->ServerName); - send_cmd("", "& %s 1 %ld %s %s %s 0 %s %s * :%s", u->nick.c_str(), u->timestamp, u->GetIdent().c_str(), u->host.c_str(), Config->ServerName.c_str(), modes.c_str(), u->host.c_str(), u->realname.c_str()); + send_cmd("", "& %s 1 %ld %s %s %s 0 %s %s * :%s", u->nick.c_str(), static_cast<long>(u->timestamp), u->GetIdent().c_str(), u->host.c_str(), Config->ServerName.c_str(), modes.c_str(), u->host.c_str(), u->realname.c_str()); } void SendKickInternal(const BotInfo *source, const Channel *chan, const User *user, const Anope::string &buf) diff --git a/src/init.cpp b/src/init.cpp index 841fdc55e..239b9df48 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -299,6 +299,8 @@ void Init(int ac, char **av) throw FatalException("Unable to chdir to " + services_dir + ": " + Anope::LastError()); } + init_core_messages(); + Log(LOG_TERMINAL) << "Anope " << Anope::Version() << ", " << Anope::Build(); #ifdef _WIN32 Log(LOG_TERMINAL) << "Using configuration file " << services_dir << "\\" << services_conf; diff --git a/src/mail.cpp b/src/mail.cpp index d59903726..fdbd05dd9 100644 --- a/src/mail.cpp +++ b/src/mail.cpp @@ -1,6 +1,6 @@ #include "services.h" -MailThread::MailThread(const Anope::string &mailto, const Anope::string &addr, const Anope::string &subject, const Anope::string &message) : Thread(), MailTo(mailto), Addr(addr), Subject(subject), Message(message), Success(false), DontQuoteAddresses(Config->DontQuoteAddresses) +MailThread::MailThread(const Anope::string &mailto, const Anope::string &addr, const Anope::string &subject, const Anope::string &message) : Thread(), MailTo(mailto), Addr(addr), Subject(subject), Message(message), DontQuoteAddresses(Config->DontQuoteAddresses), Success(false) { } diff --git a/src/messages.cpp b/src/messages.cpp index e22f856c6..6d93aeb13 100644 --- a/src/messages.cpp +++ b/src/messages.cpp @@ -225,7 +225,7 @@ bool m_stats(const Anope::string &source, const std::vector<Anope::string> ¶ if (u && is_oper(u)) { ircdproto->SendNumeric(Config->ServerName, 211, source, "Server SendBuf SentBytes SentMsgs RecvBuf RecvBytes RecvMsgs ConnTime"); - ircdproto->SendNumeric(Config->ServerName, 211, source, "%s %d %d %d %d %d %d %ld", uplink_server->host.c_str(), UplinkSock->WriteBufferLen(), TotalWritten, -1, UplinkSock->ReadBufferLen(), TotalRead, -1, Anope::CurTime - start_time); + ircdproto->SendNumeric(Config->ServerName, 211, source, "%s %d %d %d %d %d %d %ld", uplink_server->host.c_str(), UplinkSock->WriteBufferLen(), TotalWritten, -1, UplinkSock->ReadBufferLen(), TotalRead, -1, static_cast<long>(Anope::CurTime - start_time)); } ircdproto->SendNumeric(Config->ServerName, 219, source, "%c :End of /STATS report.", params[0][0]); @@ -289,7 +289,7 @@ int m_whois(const Anope::string &source, const Anope::string &who) ircdproto->SendNumeric(Config->ServerName, 311, source, "%s %s %s * :%s", bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str()); ircdproto->SendNumeric(Config->ServerName, 307, source, "%s :is a registered nick", bi->nick.c_str()); ircdproto->SendNumeric(Config->ServerName, 312, source, "%s %s :%s", bi->nick.c_str(), Config->ServerName.c_str(), Config->ServerDesc.c_str()); - ircdproto->SendNumeric(Config->ServerName, 317, source, "%s %ld %ld :seconds idle, signon time", bi->nick.c_str(), Anope::CurTime - bi->lastmsg, start_time); + ircdproto->SendNumeric(Config->ServerName, 317, source, "%s %ld %ld :seconds idle, signon time", bi->nick.c_str(), static_cast<long>(Anope::CurTime - bi->lastmsg), static_cast<long>(start_time)); ircdproto->SendNumeric(Config->ServerName, 318, source, "%s :End of /WHOIS list.", who.c_str()); } else if (!ircd->svshold && (u = finduser(who)) && u->server == Me) @@ -304,7 +304,10 @@ int m_whois(const Anope::string &source, const Anope::string &who) return MOD_CONT; } -Message message_stats("STATS", m_stats); -Message message_time("TIME", m_time); -Message message_verssion("VERSION", m_version); +void init_core_messages() +{ + static Message message_stats("STATS", m_stats); + static Message message_time("TIME", m_time); + static Message message_verssion("VERSION", m_version); +} diff --git a/src/send.cpp b/src/send.cpp index b7f7821ae..550bcab7c 100644 --- a/src/send.cpp +++ b/src/send.cpp @@ -46,8 +46,8 @@ void send_cmd(const Anope::string &source, const char *fmt, ...) } else { - UplinkSock->Write("%s", buf); - Log(LOG_RAWIO) << "Sent: "<< buf; + UplinkSock->Write(buf); + Log(LOG_RAWIO) << "Sent: " << buf; } va_end(args); |