diff options
| author | 2024-07-22 21:49:58 +0100 | |
|---|---|---|
| committer | 2024-07-23 21:46:05 +0100 | |
| commit | 81ac8ff1b8b8fa7091a2c25359152b93d9d1a49d (patch) | |
| tree | c73a62fb08eb423d49baf2da9eb8e8889b244a25 /modules/spanningtree/server.cpp | |
| parent | Merge branch 'insp4' into master. (diff) | |
Remove support for the v3 server protocol.
Diffstat (limited to 'modules/spanningtree/server.cpp')
| -rw-r--r-- | modules/spanningtree/server.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/modules/spanningtree/server.cpp b/modules/spanningtree/server.cpp index 2da9e2a00..e6ceeacbb 100644 --- a/modules/spanningtree/server.cpp +++ b/modules/spanningtree/server.cpp @@ -98,8 +98,7 @@ void CommandServer::HandleExtra(TreeServer* newserver, Params& params) std::shared_ptr<Link> TreeSocket::AuthRemote(const CommandBase::Params& params) { - size_t offset = proto_version == PROTO_INSPIRCD_3; - if (params.size() < 4+offset) + if (params.size() < 4) { SendError("Protocol error - Not enough parameters for SERVER command"); return nullptr; @@ -107,7 +106,7 @@ std::shared_ptr<Link> TreeSocket::AuthRemote(const CommandBase::Params& params) const std::string& sname = params[0]; const std::string& password = params[1]; - const std::string& sid = params[2+offset]; + const std::string& sid = params[2]; const std::string& description = params.back(); this->SendCapabilities(2); @@ -171,7 +170,7 @@ bool TreeSocket::Outbound_Reply_Server(CommandBase::Params& params) * While we're at it, create a treeserver object so we know about them. * -- w */ - FinishAuth(params[0], params[proto_version == PROTO_INSPIRCD_3 ? 3 : 2], params.back(), x->Hidden); + FinishAuth(params[0], params[2], params.back(), x->Hidden); return true; } @@ -217,16 +216,15 @@ bool TreeSocket::Inbound_Server(CommandBase::Params& params) { // Save these for later, so when they accept our credentials (indicated by BURST) we remember them this->capab->hidden = x->Hidden; - this->capab->sid = params[proto_version == PROTO_INSPIRCD_3 ? 3 : 2]; + this->capab->sid = params[2]; this->capab->description = params.back(); this->capab->name = params[0]; // Send our details: Our server name and description and hopcount of 0, // along with the sendpass from this block. - this->WriteLine(fmt::format("SERVER {} {} {}{} :{}", + this->WriteLine(fmt::format("SERVER {} {} {} :{}", ServerInstance->Config->ServerName, TreeSocket::MakePass(x->SendPass, this->GetTheirChallenge()), - proto_version == PROTO_INSPIRCD_3 ? "0 " : "", ServerInstance->Config->ServerId, ServerInstance->Config->ServerDesc )); |
