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

Added a plexus3 protocol module

This commit is contained in:
Adam
2010-11-22 13:06:44 -06:00
parent 697dc89382
commit 1a286397e3
15 changed files with 802 additions and 103 deletions
+13 -18
View File
@@ -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 };