1
0
mirror of https://github.com/anope/anope.git synced 2026-07-10 17:23:14 +02:00

Removed a lot of the old capab flags we dont/have never used

This commit is contained in:
Adam
2011-02-09 20:09:26 -05:00
parent eec897762c
commit f463b772b0
11 changed files with 7 additions and 137 deletions
+6 -61
View File
@@ -175,74 +175,19 @@ How To Add IRCd Support
5) CAPAB/PROTOCTL
Most IRCD send a CAPAB or PROTOCTL line so that they can work out what
the other end of the connection is capable of doing. Anope has a function
to read these lines and set itself up to to handle these events better.
When adding support for your ircd, take the following steps.
Most IRCDs send a CAPAB or PROTOCTL line so that they can work out what
the other end of the connection is capable of doing. The protocol module should
handle all of these without the cores knowledge with the exception of the following:
1) In the module constructor you must tell Anope what the uplink is capable of that
isn't already passed in the CAPAB/PROTOCTL, you do this by something similar to:
CapabType c[] = { CAPAB_NOQUIT, CAPAB_NICKIP, CAPAB_ZIP, CAPAB_TOKEN, CAPAB_SSJ3, CAPAB_NICK2, CAPAB_VL, CAPAB_TLKEXT, CAPAB_CHANMODE, CAPAB_SJB64, CAPAB_NICKCHARS };
for (unsigned i = 0; i < 11; ++i)
Capab.SetFlag(c[i]);
Anything else given to Anope in the CAPAB/PROTOCTL message will be handled later by CapabParse.
The available CAPAB options are:
--------------------------------------------------------------------------
Define | Description
----------------|------------|-----------|--------------------------------
----------------|---------------------------------------------------------
CAPAB_NOQUIT | NOQUIT protocol support
CAPAB_TSMODE | Chanmodes are timestamped
CAPAB_UNCONNECT | UNCONNECT protocol support
CAPAB_NICKIP | IP sent in the NICK line
CAPAB_NSJOIN | Smart SJOIN support
CAPAB_ZIP | Support for gzipped links
CAPAB_BURST | Supports BURST command
CAPAB_TS3 | Support for TS3 protocol
CAPAB_TS5 | Support for TS5 protocol
CAPAB_DKEY | DH-Key exchange using DKEY
CAPAB_DOZIP | Link traffic will be gzipped
CAPAB_DODKEY | Do DKEY with this link
CAPAB_QS | Supports quit storm removal
CAPAB_SCS | String Cache System support
CAPAB_PT4 | Support for PT4 protocol
CAPAB_UID | Support for UIDs
CAPAB_KNOCK | Supports KNOCK
CAPAB_CLIENT | Supports CLIENT
CAPAB_IPV6 | Support for IPv6 addresses
CAPAB_SSJ5 | Smart Join protocol 5 support
CAPAB_SN2 | Support for SN2 protocol
CAPAB_VHOST | Supports VHOST protocol
CAPAB_TOKEN | Supports s2s tokens
CAPAB_SSJ3 | Smart Join protocol 3 support
CAPAB_NICK2 | Support for extended NICK (v2)
CAPAB_UMODE2 | Supports UMODE2 command
CAPAB_VL | VLine information in info field
CAPAB_TLKEXT | Not 8, but 10 params in TKL's
CAPAB_CHANMODE | Channel modes are passed here
CAPAB_SJB64 | SJOIN timestamps are base64 encoded
CAPAB_NICKCHARS | Character set used by the IRCD for nicks
CAPAB_QS | Quitstorm - same as NOQUIT
2) Ensure that the CAPAB/PROTOCTL event his handled correctly.
A) In the function module constructor make sure that you have the
following two lines:
Message message_capab("CAPAB", event_capab);
B) Add the function to handle the event
bool event_capab(const Anope::string &source, const std::vector<Anope::string> &params)
{
CapabParse(params);
return true;
}
This function should call the CapabParse function which parses
the received CAPAB/PROTOCTL line.
You can override the default OnCapab method in IRCdMessage if required.
6) IRCDProto Class
-26
View File
@@ -18,33 +18,7 @@ enum CapabType
CAPAB_NOQUIT,
CAPAB_TSMODE,
CAPAB_UNCONNECT,
CAPAB_NICKIP,
CAPAB_NSJOIN,
CAPAB_ZIP,
CAPAB_BURST,
CAPAB_TS3,
CAPAB_TS5,
CAPAB_DKEY,
CAPAB_DOZIP,
CAPAB_DODKEY,
CAPAB_QS,
CAPAB_SCS,
CAPAB_PT4,
CAPAB_UID,
CAPAB_KNOCK,
CAPAB_CLIENT,
CAPAB_IPV6,
CAPAB_SSJ5,
CAPAB_SN2,
CAPAB_VHOST,
CAPAB_TOKEN,
CAPAB_SSJ3,
CAPAB_NICK2,
CAPAB_VL,
CAPAB_TLKEXT,
CAPAB_CHANMODE,
CAPAB_SJB64,
CAPAB_NICKCHARS,
CAPAB_END
};
-4
View File
@@ -603,10 +603,6 @@ class ProtoBahamut : public Module
this->SetAuthor("Anope");
this->SetType(PROTOCOL);
CapabType c[] = { CAPAB_NOQUIT, CAPAB_TSMODE, CAPAB_UNCONNECT, CAPAB_BURST, CAPAB_DKEY, CAPAB_DOZIP };
for (unsigned i = 0; i < 6; ++i)
Capab.SetFlag(c[i]);
AddModes();
pmodule_ircd_var(myIrcd);
-4
View File
@@ -904,10 +904,6 @@ class ProtoInspIRCd : public Module
this->SetAuthor("Anope");
this->SetType(PROTOCOL);
CapabType c[] = { CAPAB_NOQUIT, CAPAB_SSJ3, CAPAB_NICK2, CAPAB_VL, CAPAB_TLKEXT };
for (unsigned i = 0; i < 5; ++i)
Capab.SetFlag(c[i]);
AddModes();
pmodule_ircd_var(myIrcd);
-4
View File
@@ -726,10 +726,6 @@ class ProtoInspIRCd : public Module
this->SetAuthor("Anope");
this->SetType(PROTOCOL);
CapabType c[] = { CAPAB_NOQUIT, CAPAB_SSJ3, CAPAB_NICK2, CAPAB_VL, CAPAB_TLKEXT };
for (unsigned i = 0; i < 5; ++i)
Capab.SetFlag(c[i]);
pmodule_ircd_var(myIrcd);
pmodule_ircd_proto(&this->ircd_proto);
pmodule_ircd_message(&this->ircd_message);
-4
View File
@@ -701,10 +701,6 @@ class ProtoInspIRCd : public Module
this->SetAuthor("Anope");
this->SetType(PROTOCOL);
CapabType c[] = { CAPAB_NOQUIT, CAPAB_SSJ3, CAPAB_NICK2, CAPAB_VL, CAPAB_TLKEXT };
for (unsigned i = 0; i < 5; ++i)
Capab.SetFlag(c[i]);
pmodule_ircd_var(myIrcd);
pmodule_ircd_proto(&this->ircd_proto);
pmodule_ircd_message(&this->ircd_message);
-4
View File
@@ -661,10 +661,6 @@ class ProtoPlexus : public Module
this->SetAuthor("Anope");
this->SetType(PROTOCOL);
CapabType c[] = { CAPAB_ZIP, CAPAB_TS5, CAPAB_QS, CAPAB_UID, CAPAB_KNOCK };
for (unsigned i = 0; i < 5; ++i)
Capab.SetFlag(c[i]);
AddModes();
pmodule_ircd_var(myIrcd);
-4
View File
@@ -580,10 +580,6 @@ class ProtoRatbox : public Module
this->SetAuthor("Anope");
this->SetType(PROTOCOL);
CapabType c[] = { CAPAB_ZIP, CAPAB_TS5, CAPAB_QS, CAPAB_UID, CAPAB_KNOCK, CAPAB_TSMODE };
for (unsigned i = 0; i < 6; ++i)
Capab.SetFlag(c[i]);
AddModes();
pmodule_ircd_var(myIrcd);
-4
View File
@@ -1065,10 +1065,6 @@ class ProtoUnreal : public Module
this->SetAuthor("Anope");
this->SetType(PROTOCOL);
CapabType c[] = { CAPAB_NOQUIT, CAPAB_NICKIP, CAPAB_ZIP, CAPAB_TOKEN, CAPAB_SSJ3, CAPAB_NICK2, CAPAB_VL, CAPAB_TLKEXT, CAPAB_CHANMODE, CAPAB_NICKCHARS };
for (unsigned i = 0; i < 10; ++i)
Capab.SetFlag(c[i]);
AddModes();
pmodule_ircd_var(myIrcd);
+1
View File
@@ -574,6 +574,7 @@ bool IRCdMessage::OnCapab(const Anope::string &, const std::vector<Anope::string
if (Capab_Info[j].Token.equals_ci(params[i]))
{
Capab.SetFlag(Capab_Info[j].Flag);
Log(LOG_DEBUG) << "Capab: Enabling " << Capab_Info[j].Token;
break;
}
}
-22
View File
@@ -19,29 +19,7 @@ CapabInfo Capab_Info[] = {
{"NOQUIT", CAPAB_NOQUIT},
{"TSMODE", CAPAB_TSMODE},
{"UNCONNECT", CAPAB_UNCONNECT},
{"NICKIP", CAPAB_NICKIP},
{"SSJOIN", CAPAB_NSJOIN},
{"ZIP", CAPAB_ZIP},
{"BURST", CAPAB_BURST},
{"TS5", CAPAB_TS5},
{"TS3", CAPAB_TS3},
{"DKEY", CAPAB_DKEY},
{"PT4", CAPAB_PT4},
{"SCS", CAPAB_SCS},
{"QS", CAPAB_QS},
{"UID", CAPAB_UID},
{"KNOCK", CAPAB_KNOCK},
{"CLIENT", CAPAB_CLIENT},
{"IPV6", CAPAB_IPV6},
{"SSJ5", CAPAB_SSJ5},
{"SN2", CAPAB_SN2},
{"TOK1", CAPAB_TOKEN},
{"TOKEN", CAPAB_TOKEN},
{"VHOST", CAPAB_VHOST},
{"SSJ3", CAPAB_SSJ3},
{"SJB64", CAPAB_SJB64},
{"CHANMODES", CAPAB_CHANMODE},
{"NICKCHARS", CAPAB_NICKCHARS},
{"", CAPAB_END}
};