diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-08-31 02:21:50 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-08-31 02:21:50 +0000 |
commit | 1609ed5d3a53781586543893bace5a4eb612d8b5 (patch) | |
tree | b55fbcf9bd243e518759df85b9ad30f27099d914 /src/modules/m_spanningtree | |
parent | 29237b699f47488962133b54b0b3d1085f3c068d (diff) |
Add snomasks to UID command, after 'modes', bump protocol version, as this can cause fun masskills if an upgraded server is introduced to older servers
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10360 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r-- | src/modules/m_spanningtree/main.h | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/netburst.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/protocolinterface.cpp | 1 | ||||
-rw-r--r-- | src/modules/m_spanningtree/uid.cpp | 21 |
4 files changed, 16 insertions, 12 deletions
diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index 5b5eec634..861bf7e14 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -26,7 +26,7 @@ * Failure to document your protocol changes will result in a painfully * painful death by pain. You have been warned. */ -const long ProtocolVersion = 1200; +const long ProtocolVersion = 1201; /** Forward declarations */ diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index 2e7aab25f..26ff4b209 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -223,9 +223,9 @@ void TreeSocket::SendUsers(TreeServer* Current) TreeServer* theirserver = Utils->FindServer(u->second->server); if (theirserver) { - snprintf(data,MAXBUF,":%s UID %s %lu %s %s %s %s +%s %s %lu :%s", theirserver->GetID().c_str(), u->second->uuid.c_str(), + snprintf(data,MAXBUF,":%s UID %s %lu %s %s %s %s +%s +%s %s %lu :%s", theirserver->GetID().c_str(), u->second->uuid.c_str(), (unsigned long)u->second->age, u->second->nick.c_str(), u->second->host.c_str(), u->second->dhost.c_str(), - u->second->ident.c_str(), u->second->FormatModes(), u->second->GetIPString(), + u->second->ident.c_str(), u->second->FormatModes(), u->second->FormatNoticeMasks(), u->second->GetIPString(), (unsigned long)u->second->signon, u->second->fullname.c_str()); this->WriteLine(data); if (IS_OPER(u->second)) diff --git a/src/modules/m_spanningtree/protocolinterface.cpp b/src/modules/m_spanningtree/protocolinterface.cpp index 284f30fed..410ccfdec 100644 --- a/src/modules/m_spanningtree/protocolinterface.cpp +++ b/src/modules/m_spanningtree/protocolinterface.cpp @@ -185,6 +185,7 @@ void SpanningTreeProtocolInterface::Introduce(User* user) params.push_back(user->dhost); params.push_back(user->ident); params.push_back("+"+std::string(user->FormatModes())); + params.push_back("+"+std::string(user->FormatNoticeMasks())); params.push_back(user->GetIPString()); params.push_back(ConvToStr(user->signon)); params.push_back(":"+std::string(user->fullname)); diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp index 2ebceb3cf..0c4564719 100644 --- a/src/modules/m_spanningtree/uid.cpp +++ b/src/modules/m_spanningtree/uid.cpp @@ -33,9 +33,10 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> ¶ms) { /** Do we have enough parameters: - * UID uuid age nick host dhost ident +modestr ip.string :gecos + * 1 2 3 4 5 6 7 8 9 10 + * UID uuid age nick host dhost ident +modestr +snomasks ip.string signon :gecos */ - if (params.size() != 10) + if (params.size() != 11) { if (!params.empty()) this->WriteLine(std::string(":")+this->Instance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction ("+params[0]+" with only "+ @@ -44,7 +45,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa } time_t age_t = ConvToInt(params[1]); - time_t signon = ConvToInt(params[8]); + time_t signon = ConvToInt(params[9]); std::string empty; TreeServer* remoteserver = Utils->FindServer(source); @@ -71,7 +72,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa * Nick collision. */ Instance->Logs->Log("m_spanningtree",DEBUG,"*** Collision on %s", params[2].c_str()); - int collide = this->DoCollision(iter->second, age_t, params[5], params[7], params[0]); + int collide = this->DoCollision(iter->second, age_t, params[5], params[8], params[0]); if (collide == 2) { @@ -100,7 +101,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa _new->dhost.assign(params[4], 0, 64); _new->server = this->Instance->FindServerNamePtr(remoteserver->GetName().c_str()); _new->ident.assign(params[5], 0, MAXBUF); - _new->fullname.assign(params[9], 0, MAXBUF); + _new->fullname.assign(params[10], 0, MAXBUF); _new->registered = REG_ALL; _new->signon = signon; _new->age = age_t; @@ -123,15 +124,17 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa } } + _new->ProcessNoticeMasks(params[7].c_str()); + /* now we've done with modes processing, put the + back for remote servers */ params[6] = "+" + params[6]; #ifdef SUPPORT_IP6LINKS - if (params[7].find_first_of(":") != std::string::npos) - _new->SetSockAddr(AF_INET6, params[7].c_str(), 0); + if (params[8].find_first_of(":") != std::string::npos) + _new->SetSockAddr(AF_INET6, params[8].c_str(), 0); else #endif - _new->SetSockAddr(AF_INET, params[7].c_str(), 0); + _new->SetSockAddr(AF_INET, params[8].c_str(), 0); Instance->Users->AddGlobalClone(_new); @@ -143,7 +146,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa if (dosend) this->Instance->SNO->WriteToSnoMask('C',"Client connecting at %s: %s!%s@%s [%s] [%s]", _new->server, _new->nick.c_str(), _new->ident.c_str(), _new->host.c_str(), _new->GetIPString(), _new->fullname.c_str()); - params[9] = ":" + params[9]; + params[10] = ":" + params[10]; Utils->DoOneToAllButSender(source, "UID", params, source); Instance->PI->Introduce(_new); |