1
0
mirror of https://github.com/anope/anope.git synced 2026-06-28 15:56:38 +02:00

Parse and store the spanningtree protocol version for InspIRCd

This commit is contained in:
attilamolnar
2012-10-05 01:01:17 +02:00
committed by Adam
parent e747ba6c26
commit 2d9541c4c8
2 changed files with 6 additions and 1 deletions
+1
View File
@@ -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;
+5 -1
View File
@@ -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";