diff options
| author | attilamolnar <attilamolnar@hush.com> | 2012-10-05 01:01:17 +0200 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2012-10-06 02:18:48 -0400 |
| commit | 2d9541c4c8f5c725e95c55a2ccb8181c8d5f8be3 (patch) | |
| tree | c562f2fe98ae951f6cb6db81cc95fc22fc35bb5b | |
| parent | e747ba6c26f93a33b3bbc400de48bb4b3773d396 (diff) | |
Parse and store the spanningtree protocol version for InspIRCd
| -rw-r--r-- | modules/protocol/inspircd12.cpp | 1 | ||||
| -rw-r--r-- | modules/protocol/inspircd20.cpp | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp index e71e7dbc3..27ec1249a 100644 --- a/modules/protocol/inspircd12.cpp +++ b/modules/protocol/inspircd12.cpp @@ -18,6 +18,7 @@ static bool has_globopsmod = false; static bool has_chghostmod = false; static bool has_chgidentmod = false; static bool has_rlinemod = false; +static unsigned int spanningtree_proto_ver = 1201; #include "inspircd-ts6.h" static bool has_servicesmod = false; diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index 4c2b03544..58494bb51 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -18,6 +18,7 @@ static bool has_chghostmod = false; static bool has_chgidentmod = false; static bool has_globopsmod = true; // Not a typo static bool has_rlinemod = false; +static unsigned int spanningtree_proto_ver = 0; #include "inspircd-ts6.h" static bool has_servicesmod = false; @@ -117,7 +118,10 @@ struct IRCDMessageCapab : IRCDMessage { if (params[0].equals_cs("START")) { - if (params.size() < 2 || (Anope::string(params[1]).is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0) < 1202) + if (params.size() >= 2) + spanningtree_proto_ver = (Anope::string(params[1]).is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0); + + if (spanningtree_proto_ver < 1202) { UplinkSocket::Message() << "ERROR :Protocol mismatch, no or invalid protocol version given in CAPAB START"; quitmsg = "Protocol mismatch, no or invalid protocol version given in CAPAB START"; |
