]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
New events for special. Event id's "new_server" and "lost_server". The data is a...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 1 Nov 2006 17:38:35 +0000 (17:38 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 1 Nov 2006 17:38:35 +0000 (17:38 +0000)
Eventally, i might expand this to include more data about the server such as its 'gecos' field etc, but not just yet. Let me know what data you want first.
Event source is valid and will point at the protocol module.

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5623 e03df62e-2008-0410-955e-edbf42e46eb7

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

index 014f729b0b8cf4b06ef312f49583ad090b4e5d8b..1a56978a2d5e21758fb46b57c834beaa146b31f9 100644 (file)
@@ -211,14 +211,6 @@ class InspIRCd : public classbase
        /** Holds a string describing the last module error to occur
         */
        char MODERR[MAXBUF];
-
-       /** This is an internal flag used by the mainloop
-        */
-       bool expire_run;
-
-       /** List of server names we've seen.
-        */
-       servernamelist servernames;
  
        /** Remove a ModuleFactory pointer
         * @param j Index number of the ModuleFactory to remove
@@ -348,6 +340,10 @@ class InspIRCd : public classbase
        FileLogger* Logger;
 
  public:
+        /** List of server names we've seen.
+        */
+       servernamelist servernames;
+
        /** Time this ircd was booted
         */
        time_t startup_time;
index 8a65ea82a049e506385471ab7565765d419bac4a..8b115815d1549f7b61ad95fa889ed7073d2da525 100644 (file)
@@ -1058,6 +1058,9 @@ class TreeSocket : public InspSocket
        {
                if ((Current) && (Current != Utils->TreeRoot))
                {
+                       Event rmode((char*)Current->GetName().c_str(), (Module*)Utils->Creator, "lost_server");
+                       rmode.Send(Instance);
+
                        std::deque<std::string> params;
                        params.push_back(Current->GetName());
                        params.push_back(":"+reason);
@@ -3345,6 +3348,10 @@ class TreeSocket : public InspSocket
                                                sourceserv = this->InboundServerName;
                                        }
                                        this->Instance->SNO->WriteToSnoMask('l',"Received end of netburst from \2%s\2",sourceserv.c_str());
+
+                                       Event rmode((char*)sourceserv.c_str(), (Module*)Utils->Creator, "new_server");
+                                       rmode.Send(Instance);
+
                                        return true;
                                }
                                else