mirror of
https://github.com/anope/anope.git
synced 2026-06-28 21:56:37 +02:00
Fixed some Windows problems
This commit is contained in:
@@ -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 ****/
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
+1
-1
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+8
-5
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user