summaryrefslogtreecommitdiff
path: root/modules/protocol/ratbox.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-11-22 13:06:44 -0600
committerAdam <Adam@anope.org>2010-12-12 19:36:16 -0500
commit1a286397e36b9442e43f67584e026f321a10d552 (patch)
tree8b87d074ba3ad7152f2b1a2e29ad04e0bfc5e7af /modules/protocol/ratbox.cpp
parent697dc8938279f33f2ac2c0b2248793c75de07b19 (diff)
Added a plexus3 protocol module
Diffstat (limited to 'modules/protocol/ratbox.cpp')
-rw-r--r--modules/protocol/ratbox.cpp31
1 files changed, 13 insertions, 18 deletions
diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp
index 0e034aa00..9190d75cd 100644
--- a/modules/protocol/ratbox.cpp
+++ b/modules/protocol/ratbox.cpp
@@ -12,12 +12,11 @@
#include "services.h"
#include "modules.h"
-static Anope::string TS6UPLINK; // XXX is this needed?
+static Anope::string TS6UPLINK;
IRCDVar myIrcd[] = {
{"Ratbox 2.0+", /* ircd name */
"+oi", /* Modes used by pseudoclients */
- 2, /* Chan Max Symbols */
0, /* SVSNICK */
0, /* Vhost */
1, /* Supports SNlines */
@@ -27,7 +26,6 @@ IRCDVar myIrcd[] = {
1, /* Chan SQlines */
0, /* Quit on Kill */
0, /* SVSMODE unban */
- 0, /* Reverse */
0, /* vidents */
0, /* svshold */
0, /* time stamp on mode */
@@ -88,7 +86,7 @@ void ratbox_cmd_capab()
/* PASS */
void ratbox_cmd_pass(const Anope::string &pass)
{
- send_cmd("", "PASS %s TS 6 :%s", pass.c_str(), TS6SID.c_str());
+ send_cmd("", "PASS %s TS 6 :%s", pass.c_str(), Config->Numeric.c_str());
}
class RatboxProto : public IRCDProto
@@ -98,12 +96,12 @@ class RatboxProto : public IRCDProto
if (source)
send_cmd(source->GetUID(), "OPERWALL :%s", buf.c_str());
else
- send_cmd(TS6SID, "OPERWALL :%s", buf.c_str());
+ send_cmd(Config->Numeric, "OPERWALL :%s", buf.c_str());
}
void SendSQLine(const XLine *x)
{
- send_cmd(TS6SID, "RESV * %s :%s", x->Mask.c_str(), x->Reason.c_str());
+ send_cmd(Config->Numeric, "RESV * %s :%s", x->Mask.c_str(), x->Reason.c_str());
}
void SendSGLineDel(const XLine *x)
@@ -126,7 +124,7 @@ class RatboxProto : public IRCDProto
void SendSQLineDel(const XLine *x)
{
- send_cmd(TS6SID, "UNRESV * %s", x->Mask.c_str());
+ send_cmd(Config->Numeric, "UNRESV * %s", x->Mask.c_str());
}
void SendJoin(const BotInfo *user, const Anope::string &channel, time_t chantime)
@@ -147,7 +145,7 @@ class RatboxProto : public IRCDProto
void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf)
{
- send_cmd(source ? source->GetUID() : TS6SID, "KILL %s :%s", user->GetUID().c_str(), buf.c_str());
+ send_cmd(source ? source->GetUID() : Config->Numeric, "KILL %s :%s", user->GetUID().c_str(), buf.c_str());
}
void SendSVSMode(const User *u, int ac, const char **av)
@@ -173,7 +171,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(), static_cast<long>(u->timestamp), modes.c_str(), u->GetIdent().c_str(), u->host.c_str(), u->GetUID().c_str(), u->realname.c_str());
+ send_cmd(Config->Numeric, "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)
@@ -187,7 +185,7 @@ class RatboxProto : public IRCDProto
void SendNumericInternal(const Anope::string &, int numeric, const Anope::string &dest, const Anope::string &buf)
{
// This might need to be set in the call to SendNumeric instead of here, will review later -- CyberBotX
- send_cmd(TS6SID, "%03d %s %s", numeric, dest.c_str(), buf.c_str());
+ send_cmd(Config->Numeric, "%03d %s %s", numeric, dest.c_str(), buf.c_str());
}
void SendModeInternal(const BotInfo *bi, const Channel *dest, const Anope::string &buf)
@@ -195,14 +193,14 @@ class RatboxProto : public IRCDProto
if (bi)
send_cmd(bi->GetUID(), "MODE %s %s", dest->name.c_str(), buf.c_str());
else
- send_cmd(TS6SID, "MODE %s %s", dest->name.c_str(), buf.c_str());
+ send_cmd(Config->Numeric, "MODE %s %s", dest->name.c_str(), buf.c_str());
}
void SendModeInternal(const BotInfo *bi, const User *u, const Anope::string &buf)
{
if (buf.empty())
return;
- send_cmd(bi ? bi->GetUID() : TS6SID, "SVSMODE %s %s", u->nick.c_str(), buf.c_str());
+ send_cmd(bi ? bi->GetUID() : Config->Numeric, "SVSMODE %s %s", u->nick.c_str(), buf.c_str());
}
void SendKickInternal(const BotInfo *bi, const Channel *chan, const User *user, const Anope::string &buf)
@@ -227,12 +225,12 @@ class RatboxProto : public IRCDProto
void SendAccountLogin(const User *u, const NickCore *account)
{
- send_cmd(TS6SID, "ENCAP * SU %s %s", u->GetUID().c_str(), account->display.c_str());
+ send_cmd(Config->Numeric, "ENCAP * SU %s %s", u->GetUID().c_str(), account->display.c_str());
}
void SendAccountLogout(const User *u, const NickCore *account)
{
- send_cmd(TS6SID, "ENCAP * SU %s", u->GetUID().c_str());
+ send_cmd(Config->Numeric, "ENCAP * SU %s", u->GetUID().c_str());
}
bool IsNickValid(const Anope::string &nick)
@@ -250,7 +248,7 @@ class RatboxProto : public IRCDProto
if (needjoin)
{
ChannelStatus status;
- status .SetFlag(CMODE_OP);
+ status.SetFlag(CMODE_OP);
ChannelContainer cc(c);
cc.Status = &status;
ircdproto->SendJoin(bi, &cc);
@@ -701,9 +699,6 @@ class ProtoRatbox : public Module
this->SetAuthor("Anope");
this->SetType(PROTOCOL);
- if (!Config->Numeric.empty())
- TS6SID = Config->Numeric;
-
pmodule_ircd_var(myIrcd);
CapabType c[] = { CAPAB_ZIP, CAPAB_TS5, CAPAB_QS, CAPAB_UID, CAPAB_KNOCK, CAPAB_TSMODE };