]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Added proper administrativia notices to CONNECT and inbound connections
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 27 Nov 2005 16:39:48 +0000 (16:39 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 27 Nov 2005 16:39:48 +0000 (16:39 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1969 e03df62e-2008-0410-955e-edbf42e46eb7

include/socket.h
src/modules/m_spanningtree.cpp
src/socket.cpp

index ace21b78fbaffd6d35bb94e943cf8437f8a0c45c..7571d14813fa616582052da36d32a4d555833663 100644 (file)
@@ -46,7 +46,7 @@ private:
        socklen_t length;
 public:
        InspSocket();
-       InspSocket(int newfd);
+       InspSocket(int newfd, char* ip);
        InspSocket(std::string host, int port, bool listening, unsigned long maxtime);
        virtual bool OnConnected();
        virtual void OnError(InspSocketError e);
index 71f3af876b66dd273413c974910fd3f39c36c107..8ec9e564e186f61d15891f4036e82c962751e2ff 100644 (file)
@@ -66,6 +66,41 @@ class TreeServer
                UserCount = OperCount = 0;
        }
 
+       std::string GetName()
+       {
+               return this->ServerName;
+       }
+
+       std::string GetDesc()
+       {
+               return this->ServerDesc;
+       }
+
+       std::string GetVersion()
+       {
+               return this->VersionString;
+       }
+
+       int GetUserCount()
+       {
+               return this->UserCount;
+       }
+
+       int GetOperCount()
+       {
+               return this->OperCount;
+       }
+
+       TreeSocket* GetSocket()
+       {
+               return this->Socket;
+       }
+
+       TreeServer* GetParent()
+       {
+               return this->Parent;
+       }
+
        void AddChild(TreeServer* Child)
        {
                Children.push_back(Child);
@@ -128,8 +163,8 @@ class TreeSocket : public InspSocket
                this->LinkState = CONNECTING;
        }
 
-       TreeSocket(int newfd)
-               : InspSocket(newfd)
+       TreeSocket(int newfd, char* ip)
+               : InspSocket(newfd, ip)
        {
                Srv->Log(DEBUG,"Associate new inbound");
                this->LinkState = WAIT_AUTH_1;
@@ -139,6 +174,7 @@ class TreeSocket : public InspSocket
        {
                if (this->LinkState == CONNECTING)
                {
+                       Srv->SendOpers("*** Connection to "+myhost+"["+this->GetIP()+"] established.");
                        // we should send our details here.
                        // if the other side is satisfied, they send theirs.
                        // we do not need to change state here.
@@ -168,6 +204,7 @@ class TreeSocket : public InspSocket
        void DoBurst(TreeServer* s)
        {
                log(DEBUG,"Beginning network burst");
+               Srv->SendOpers("*** Bursting to "+s->GetName()+".");
                this->WriteLine("BURST");
                this->WriteLine("ENDBURST");
        }
@@ -420,7 +457,7 @@ class TreeSocket : public InspSocket
 
        virtual int OnIncomingConnection(int newsock, char* ip)
        {
-               TreeSocket* s = new TreeSocket(newsock);
+               TreeSocket* s = new TreeSocket(newsock, ip);
                Srv->AddSocket(s);
                return true;
        }
index aa028b8a587019d3f24a649dd51eb89eac9c2bd6..36b6d1d1e52d1793e3e087e719f5bece70e31a44 100644 (file)
@@ -48,10 +48,11 @@ InspSocket::InspSocket()
        this->state = I_DISCONNECTED;
 }
 
-InspSocket::InspSocket(int newfd)
+InspSocket::InspSocket(int newfd, char* ip)
 {
        this->fd = newfd;
        this->state = I_CONNECTED;
+       this->IP = ip;
 }
 
 InspSocket::InspSocket(std::string host, int port, bool listening, unsigned long maxtime)