]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket2.cpp
Add DYING link state, push error messages on link, and only limit recvq on unauthenti...
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket2.cpp
index 4b5a35d498e7cc5ac0dcb090c0d5f819459f12be..aacbbc25f68b9a52b5bc576b3b7e6efb90f94a7b 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
 #include "resolvers.h"
 
 /* Handle ERROR command */
-bool TreeSocket::Error(parameterlist &params)
+void TreeSocket::Error(parameterlist &params)
 {
-       if (params.size() < 1)
-               return false;
-       ServerInstance->SNO->WriteGlobalSno('l',"ERROR from %s: %s",(!InboundServerName.empty() ? InboundServerName.c_str() : myhost.c_str()),params[0].c_str());
-       /* we will return false to cause the socket to close. */
-       return false;
+       std::string msg = params.size() ? params[0] : "";
+       SetError("received ERROR " + msg);
 }
 
 void TreeSocket::Split(const std::string& line, std::string& prefix, std::string& command, parameterlist& params)
@@ -222,6 +219,8 @@ void TreeSocket::ProcessLine(std::string &line)
                         */
                        this->ProcessConnectedLine(prefix, command, params);
                break;
+               case DYING:
+               break;
        }
 }
 
@@ -293,27 +292,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
                command = "MODE";
 
        // TODO move all this into Commands
-       if (command == "UID")
-       {
-               this->ParseUID(prefix, params);
-       }
-       else if (command == "FJOIN")
-       {
-               this->ForceJoin(who,params);
-       }
-       else if (command == "STATS")
-       {
-               this->Stats(prefix, params);
-       }
-       else if (command == "MOTD")
-       {
-               this->Motd(prefix, params);
-       }
-       else if (command == "ADMIN")
-       {
-               this->Admin(prefix, params);
-       }
-       else if (command == "MAP")
+       if (command == "MAP")
        {
                Utils->Creator->HandleMap(params, who);
        }
@@ -325,26 +304,10 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
        {
                this->Error(params);
        }
-       else if (command == "OPERTYPE")
-       {
-               this->OperType(prefix,params);
-       }
        else if (command == "AWAY")
        {
                this->Away(prefix,params);
        }
-       else if (command == "FMODE")
-       {
-               this->ForceMode(who,params);
-       }
-       else if (command == "FTOPIC")
-       {
-               this->ForceTopic(prefix,params);
-       }
-       else if (command == "METADATA")
-       {
-               this->MetaData(prefix,params);
-       }
        else if (command == "PING")
        {
                this->LocalPing(prefix,params);
@@ -363,18 +326,6 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
        {
                this->ServerVersion(prefix,params);
        }
-       else if (command == "FHOST")
-       {
-               this->ChangeHost(prefix,params);
-       }
-       else if (command == "FNAME")
-       {
-               this->ChangeName(prefix,params);
-       }
-       else if (command == "FIDENT")
-       {
-               this->ChangeIdent(prefix,params);
-       }
        else if (command == "ADDLINE")
        {
                this->AddLine(prefix,params);
@@ -383,10 +334,6 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
        {
                this->DelLine(prefix,params);
        }
-       else if (command == "SVSNICK")
-       {
-               this->SVSNick(prefix,params);
-       }
        else if (command == "SAVE")
        {
                this->ForceNick(prefix,params);
@@ -403,18 +350,6 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
        {
                this->Push(prefix,params);
        }
-       else if (command == "TIME")
-       {
-               this->Time(prefix,params);
-       }
-       else if (command == "SVSJOIN")
-       {
-               this->ServiceJoin(prefix,params);
-       }
-       else if (command == "SVSPART")
-       {
-               this->ServicePart(prefix,params);
-       }
        else if (command == "SQUIT")
        {
                if (params.size() == 2)
@@ -422,15 +357,6 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
                        this->Squit(Utils->FindServer(params[0]),params[1]);
                }
        }
-       else if (command == "MODENOTICE")
-       {
-               if (params.size() >= 2)
-               {
-                       ServerInstance->Users->WriteMode(params[0].c_str(), WM_AND, "*** From %s: %s",
-                               who->nick.c_str(), params[1].c_str());
-               }
-               Utils->DoOneToAllButSender(prefix, command, params, prefix);
-       }
        else if (command == "SNONOTICE")
        {
                if (params.size() >= 2)