]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Be consistent. Use ServerInstance in all places instead of 'Instance' in half. This...
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 21 Sep 2008 12:56:03 +0000 (12:56 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 21 Sep 2008 12:56:03 +0000 (12:56 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10579 e03df62e-2008-0410-955e-edbf42e46eb7

39 files changed:
include/inspsocket.h
src/inspsocket.cpp
src/modules/extra/m_mssql.cpp
src/modules/extra/m_pgsql.cpp
src/modules/extra/m_sqlite3.cpp
src/modules/m_httpd.cpp
src/modules/m_spanningtree/addline.cpp
src/modules/m_spanningtree/admin.cpp
src/modules/m_spanningtree/capab.cpp
src/modules/m_spanningtree/delline.cpp
src/modules/m_spanningtree/encap.cpp
src/modules/m_spanningtree/fhost.cpp
src/modules/m_spanningtree/fjoin.cpp
src/modules/m_spanningtree/fmode.cpp
src/modules/m_spanningtree/fname.cpp
src/modules/m_spanningtree/ftopic.cpp
src/modules/m_spanningtree/hmac.cpp
src/modules/m_spanningtree/kill.cpp
src/modules/m_spanningtree/metadata.cpp
src/modules/m_spanningtree/modules.cpp
src/modules/m_spanningtree/motd.cpp
src/modules/m_spanningtree/netburst.cpp
src/modules/m_spanningtree/nickcollide.cpp
src/modules/m_spanningtree/operquit.cpp
src/modules/m_spanningtree/opertype.cpp
src/modules/m_spanningtree/ping.cpp
src/modules/m_spanningtree/pong.cpp
src/modules/m_spanningtree/privmsg.cpp
src/modules/m_spanningtree/push.cpp
src/modules/m_spanningtree/server.cpp
src/modules/m_spanningtree/stats.cpp
src/modules/m_spanningtree/svsjoin.cpp
src/modules/m_spanningtree/svsnick.cpp
src/modules/m_spanningtree/svspart.cpp
src/modules/m_spanningtree/time.cpp
src/modules/m_spanningtree/treesocket1.cpp
src/modules/m_spanningtree/treesocket2.cpp
src/modules/m_spanningtree/uid.cpp
src/modules/m_spanningtree/whois.cpp

index ebdea5e4e6b1d19a581e99aa1804d1ce241688f7..67b2c02405c5a3897888800a97063714f08f45cd 100644 (file)
@@ -107,7 +107,7 @@ class CoreExport BufferedSocket : public EventHandler
 
        /** Instance we were created by
         */
-       InspIRCd* Instance;
+       InspIRCd* ServerInstance;
 
        /** Timeout class or NULL
         */
index 6407b213f848bcfd5553019769034593ddbbf4b0..2e9114a2be78e818b55e9c652bcd6811d3987d91 100644 (file)
@@ -28,7 +28,7 @@ BufferedSocket::BufferedSocket(InspIRCd* SI)
        this->Timeout = NULL;
        this->state = I_DISCONNECTED;
        this->fd = -1;
-       this->Instance = SI;
+       this->ServerInstance = SI;
 }
 
 BufferedSocket::BufferedSocket(InspIRCd* SI, int newfd, const char* ip)
@@ -37,16 +37,16 @@ BufferedSocket::BufferedSocket(InspIRCd* SI, int newfd, const char* ip)
        this->fd = newfd;
        this->state = I_CONNECTED;
        strlcpy(this->IP,ip,MAXBUF);
-       this->Instance = SI;
+       this->ServerInstance = SI;
        if (this->fd > -1)
-               this->Instance->SE->AddFd(this);
+               this->ServerInstance->SE->AddFd(this);
 }
 
 BufferedSocket::BufferedSocket(InspIRCd* SI, const std::string &ipaddr, int aport, unsigned long maxtime, const std::string &connectbindip)
 {
        this->cbindip = connectbindip;
        this->fd = -1;
-       this->Instance = SI;
+       this->ServerInstance = SI;
        strlcpy(host,ipaddr.c_str(),MAXBUF);
        this->Timeout = NULL;
 
@@ -70,7 +70,7 @@ BufferedSocket::BufferedSocket(InspIRCd* SI, const std::string &ipaddr, int apor
        }
        if (!ipvalid)
        {
-               this->Instance->Logs->Log("SOCKET", DEBUG,"BUG: Hostname passed to BufferedSocket, rather than an IP address!");
+               this->ServerInstance->Logs->Log("SOCKET", DEBUG,"BUG: Hostname passed to BufferedSocket, rather than an IP address!");
                this->OnError(I_ERR_CONNECT);
                this->Close();
                this->fd = -1;
@@ -98,7 +98,7 @@ void BufferedSocket::SetQueues()
        int recvbuf = 32768;
        if(setsockopt(this->fd,SOL_SOCKET,SO_SNDBUF,(const char *)&sendbuf,sizeof(sendbuf)) || setsockopt(this->fd,SOL_SOCKET,SO_RCVBUF,(const char *)&recvbuf,sizeof(sendbuf)))
        {
-               //this->Instance->Log(DEFAULT, "Could not increase SO_SNDBUF/SO_RCVBUF for socket %u", GetFd());
+               //this->ServerInstance->Log(DEFAULT, "Could not increase SO_SNDBUF/SO_RCVBUF for socket %u", GetFd());
                ; // do nothing. I'm a little sick of people trying to interpret this message as a result of why their incorrect setups don't work.
        }
 }
@@ -113,7 +113,7 @@ void BufferedSocket::SetQueues()
  */
 bool BufferedSocket::BindAddr(const std::string &ip)
 {
-       ConfigReader Conf(this->Instance);
+       ConfigReader Conf(this->ServerInstance);
        socklen_t size = sizeof(sockaddr_in);
 #ifdef IPV6
        bool v6 = false;
@@ -167,7 +167,7 @@ bool BufferedSocket::BindAddr(const std::string &ip)
                                        }
                                }
 
-                               if (Instance->SE->Bind(this->fd, s, size) < 0)
+                               if (ServerInstance->SE->Bind(this->fd, s, size) < 0)
                                {
                                        this->state = I_ERROR;
                                        this->OnError(I_ERR_BIND);
@@ -182,7 +182,7 @@ bool BufferedSocket::BindAddr(const std::string &ip)
                }
                j++;
        }
-       Instance->Logs->Log("SOCKET", DEBUG,"nothing in the config to bind()!");
+       ServerInstance->Logs->Log("SOCKET", DEBUG,"nothing in the config to bind()!");
        return true;
 }
 
@@ -254,9 +254,9 @@ bool BufferedSocket::DoConnect(unsigned long maxtime)
                }
        }
 
-       Instance->SE->NonBlocking(this->fd);
+       ServerInstance->SE->NonBlocking(this->fd);
 
-       if (Instance->SE->Connect(this, (sockaddr*)addr, size) == -1)
+       if (ServerInstance->SE->Connect(this, (sockaddr*)addr, size) == -1)
        {
                if (errno != EINPROGRESS)
                {
@@ -266,14 +266,14 @@ bool BufferedSocket::DoConnect(unsigned long maxtime)
                        return false;
                }
 
-               this->Timeout = new SocketTimeout(this->GetFd(), this->Instance, this, maxtime, this->Instance->Time());
-               this->Instance->Timers->AddTimer(this->Timeout);
+               this->Timeout = new SocketTimeout(this->GetFd(), this->ServerInstance, this, maxtime, this->ServerInstance->Time());
+               this->ServerInstance->Timers->AddTimer(this->Timeout);
        }
 
        this->state = I_CONNECTING;
        if (this->fd > -1)
        {
-               if (!this->Instance->SE->AddFd(this))
+               if (!this->ServerInstance->SE->AddFd(this))
                {
                        this->OnError(I_ERR_NOMOREFDS);
                        this->Close();
@@ -283,7 +283,7 @@ bool BufferedSocket::DoConnect(unsigned long maxtime)
                this->SetQueues();
        }
 
-       Instance->Logs->Log("SOCKET", DEBUG,"BufferedSocket::DoConnect success");
+       ServerInstance->Logs->Log("SOCKET", DEBUG,"BufferedSocket::DoConnect success");
        return true;
 }
 
@@ -305,15 +305,15 @@ void BufferedSocket::Close()
                        }
                        catch (CoreException& modexcept)
                        {
-                               Instance->Logs->Log("SOCKET", DEFAULT,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
+                               ServerInstance->Logs->Log("SOCKET", DEFAULT,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
                        }
                }
-               Instance->SE->Shutdown(this, 2);
-               if (Instance->SE->Close(this) != -1)
+               ServerInstance->SE->Shutdown(this, 2);
+               if (ServerInstance->SE->Close(this) != -1)
                        this->OnClose();
 
-               if (Instance->SocketCull.find(this) == Instance->SocketCull.end())
-                       Instance->SocketCull[this] = this;
+               if (ServerInstance->SocketCull.find(this) == ServerInstance->SocketCull.end())
+                       ServerInstance->SocketCull[this] = this;
        }
        errno = save;
 }
@@ -325,11 +325,11 @@ std::string BufferedSocket::GetIP()
 
 const char* BufferedSocket::Read()
 {
-       if (!Instance->SE->BoundsCheckFd(this))
+       if (!ServerInstance->SE->BoundsCheckFd(this))
                return NULL;
 
        int n = 0;
-       char* ReadBuffer = Instance->GetReadBuffer();
+       char* ReadBuffer = ServerInstance->GetReadBuffer();
 
        if (this->GetIOHook())
        {
@@ -337,11 +337,11 @@ const char* BufferedSocket::Read()
                int MOD_RESULT = 0;
                try
                {
-                       MOD_RESULT = this->GetIOHook()->OnRawSocketRead(this->fd, ReadBuffer, Instance->Config->NetBufferSize, result2);
+                       MOD_RESULT = this->GetIOHook()->OnRawSocketRead(this->fd, ReadBuffer, ServerInstance->Config->NetBufferSize, result2);
                }
                catch (CoreException& modexcept)
                {
-                       Instance->Logs->Log("SOCKET", DEFAULT,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
+                       ServerInstance->Logs->Log("SOCKET", DEFAULT,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
                }
                if (MOD_RESULT < 0)
                {
@@ -355,7 +355,7 @@ const char* BufferedSocket::Read()
        }
        else
        {
-               n = recv(this->fd, ReadBuffer, Instance->Config->NetBufferSize, 0);
+               n = recv(this->fd, ReadBuffer, ServerInstance->Config->NetBufferSize, 0);
        }
 
        /*
@@ -397,7 +397,7 @@ void BufferedSocket::Write(const std::string &data)
        outbuffer.push_back(data);
 
        /* Mark ourselves as wanting write */
-       this->Instance->SE->WantWrite(this);
+       this->ServerInstance->SE->WantWrite(this);
 }
 
 bool BufferedSocket::FlushWriteBuffer()
@@ -419,7 +419,7 @@ bool BufferedSocket::FlushWriteBuffer()
                                }
                                catch (CoreException& modexcept)
                                {
-                                       Instance->Logs->Log("SOCKET", DEBUG,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
+                                       ServerInstance->Logs->Log("SOCKET", DEBUG,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
                                        return true;
                                }
                        }
@@ -432,7 +432,7 @@ bool BufferedSocket::FlushWriteBuffer()
                        while (outbuffer.size() && (errno != EAGAIN))
                        {
                                /* Send a line */
-                               int result = Instance->SE->Send(this, outbuffer[0].c_str(), outbuffer[0].length(), 0);
+                               int result = ServerInstance->SE->Send(this, outbuffer[0].c_str(), outbuffer[0].length(), 0);
 
                                if (result > 0)
                                {
@@ -459,7 +459,7 @@ bool BufferedSocket::FlushWriteBuffer()
                                }
                                else if (result == 0)
                                {
-                                       this->Instance->SE->DelFd(this);
+                                       this->ServerInstance->SE->DelFd(this);
                                        this->Close();
                                        return true;
                                }
@@ -467,7 +467,7 @@ bool BufferedSocket::FlushWriteBuffer()
                                {
                                        this->OnError(I_ERR_WRITE);
                                        this->state = I_ERROR;
-                                       this->Instance->SE->DelFd(this);
+                                       this->ServerInstance->SE->DelFd(this);
                                        this->Close();
                                        return true;
                                }
@@ -477,7 +477,7 @@ bool BufferedSocket::FlushWriteBuffer()
 
        if ((errno == EAGAIN) && (fd > -1))
        {
-               this->Instance->SE->WantWrite(this);
+               this->ServerInstance->SE->WantWrite(this);
        }
 
        return (fd < 0);
@@ -521,14 +521,14 @@ bool BufferedSocket::InternalMarkConnected()
 
        if (this->GetIOHook())
        {
-               Instance->Logs->Log("SOCKET",DEBUG,"Hook for raw connect");
+               ServerInstance->Logs->Log("SOCKET",DEBUG,"Hook for raw connect");
                try
                {
                        this->GetIOHook()->OnRawSocketConnect(this->fd);
                }
                catch (CoreException& modexcept)
                {
-                       Instance->Logs->Log("SOCKET",DEBUG,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
+                       ServerInstance->Logs->Log("SOCKET",DEBUG,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
                        return false;
                }
        }
@@ -562,7 +562,7 @@ BufferedSocket::~BufferedSocket()
        this->Close();
        if (Timeout)
        {
-               Instance->Timers->DelTimer(Timeout);
+               ServerInstance->Timers->DelTimer(Timeout);
                Timeout = NULL;
        }
 }
@@ -591,8 +591,8 @@ void BufferedSocket::HandleEvent(EventType et, int errornum)
                                        break;
                        }
 
-                       if (this->Instance->SocketCull.find(this) == this->Instance->SocketCull.end())
-                               this->Instance->SocketCull[this] = this;
+                       if (this->ServerInstance->SocketCull.find(this) == this->ServerInstance->SocketCull.end())
+                               this->ServerInstance->SocketCull[this] = this;
                        return;
                        break;
                }
@@ -600,8 +600,8 @@ void BufferedSocket::HandleEvent(EventType et, int errornum)
                {
                        if (!this->OnDataReady())
                        {
-                               if (this->Instance->SocketCull.find(this) == this->Instance->SocketCull.end())
-                                       this->Instance->SocketCull[this] = this;
+                               if (this->ServerInstance->SocketCull.find(this) == this->ServerInstance->SocketCull.end())
+                                       this->ServerInstance->SocketCull[this] = this;
                                return;
                        }
                        break;
@@ -612,8 +612,8 @@ void BufferedSocket::HandleEvent(EventType et, int errornum)
                        {
                                if (!this->InternalMarkConnected())
                                {
-                                       if (this->Instance->SocketCull.find(this) == this->Instance->SocketCull.end())
-                                               this->Instance->SocketCull[this] = this;
+                                       if (this->ServerInstance->SocketCull.find(this) == this->ServerInstance->SocketCull.end())
+                                               this->ServerInstance->SocketCull[this] = this;
                                        return;
                                }
                                return;
@@ -622,8 +622,8 @@ void BufferedSocket::HandleEvent(EventType et, int errornum)
                        {
                                if (!this->OnWriteReady())
                                {
-                                       if (this->Instance->SocketCull.find(this) == this->Instance->SocketCull.end())
-                                               this->Instance->SocketCull[this] = this;
+                                       if (this->ServerInstance->SocketCull.find(this) == this->ServerInstance->SocketCull.end())
+                                               this->ServerInstance->SocketCull[this] = this;
                                        return;
                                }
                        }
index d52744fe43487b3a4d1c9969d79d8af7d9247014..5e766258895a308f3b15c7c4ac2c03e08a096c09 100644 (file)
@@ -46,10 +46,10 @@ class QueryThread : public Thread
 {
   private:
        ModuleMsSQL* Parent;
-       InspIRCd* Instance;
+       InspIRCd* ServerInstance;
   public:
        QueryThread(InspIRCd* si, ModuleMsSQL* mod)
-       : Thread(), Parent(mod), Instance(si)
+       : Thread(), Parent(mod), ServerInstance(si)
        {
        }
        ~QueryThread() { }
@@ -68,7 +68,7 @@ class ResultNotifier : public BufferedSocket
        virtual bool OnDataReady()
        {
                char data = 0;
-               if (Instance->SE->Recv(this, &data, 1, 0) > 0)
+               if (ServerInstance->SE->Recv(this, &data, 1, 0) > 0)
                {
                        Dispatch();
                        return true;
@@ -285,7 +285,7 @@ class SQLConn : public classbase
 {
  private:
        ResultQueue results;
-       InspIRCd* Instance;
+       InspIRCd* ServerInstance;
        Module* mod;
        SQLhost host;
        TDSLOGIN* login;
@@ -296,7 +296,7 @@ class SQLConn : public classbase
        QueryQueue queue;
 
        SQLConn(InspIRCd* SI, Module* m, const SQLhost& hi)
-       : Instance(SI), mod(m), host(hi), login(NULL), sock(NULL), context(NULL)
+       : ServerInstance(SI), mod(m), host(hi), login(NULL), sock(NULL), context(NULL)
        {
                if (OpenDB())
                {
@@ -306,7 +306,7 @@ class SQLConn : public classbase
                                if (tds_process_simple_query(sock) != TDS_SUCCEED)
                                {
                                        LoggingMutex->Lock();
-                                       Instance->Logs->Log("m_mssql",DEFAULT, "WARNING: Could not select database " + host.name + " for DB with id: " + host.id);
+                                       ServerInstance->Logs->Log("m_mssql",DEFAULT, "WARNING: Could not select database " + host.name + " for DB with id: " + host.id);
                                        LoggingMutex->Unlock();
                                        CloseDB();
                                }
@@ -314,7 +314,7 @@ class SQLConn : public classbase
                        else
                        {
                                LoggingMutex->Lock();
-                               Instance->Logs->Log("m_mssql",DEFAULT, "WARNING: Could not select database " + host.name + " for DB with id: " + host.id);
+                               ServerInstance->Logs->Log("m_mssql",DEFAULT, "WARNING: Could not select database " + host.name + " for DB with id: " + host.id);
                                LoggingMutex->Unlock();
                                CloseDB();
                        }
@@ -322,7 +322,7 @@ class SQLConn : public classbase
                else
                {
                        LoggingMutex->Lock();
-                       Instance->Logs->Log("m_mssql",DEFAULT, "WARNING: Could not connect to DB with id: " + host.id);
+                       ServerInstance->Logs->Log("m_mssql",DEFAULT, "WARNING: Could not connect to DB with id: " + host.id);
                        LoggingMutex->Unlock();
                        CloseDB();
                }
@@ -414,7 +414,7 @@ class SQLConn : public classbase
 
                char* msquery = strdup(req.query.q.data());
                LoggingMutex->Lock();
-               Instance->Logs->Log("m_mssql",DEBUG,"doing Query: %s",msquery);
+               ServerInstance->Logs->Log("m_mssql",DEBUG,"doing Query: %s",msquery);
                LoggingMutex->Unlock();
                if (tds_submit_query(sock, msquery) != TDS_SUCCEED)
                {
@@ -430,8 +430,8 @@ class SQLConn : public classbase
                int tds_res;
                while (tds_process_tokens(sock, &tds_res, NULL, TDS_TOKEN_RESULTS) == TDS_SUCCEED)
                {
-                       //Instance->Logs->Log("m_mssql",DEBUG,"<******> result type: %d", tds_res);
-                       //Instance->Logs->Log("m_mssql",DEBUG,"AFFECTED ROWS: %d", sock->rows_affected);
+                       //ServerInstance->Logs->Log("m_mssql",DEBUG,"<******> result type: %d", tds_res);
+                       //ServerInstance->Logs->Log("m_mssql",DEBUG,"AFFECTED ROWS: %d", sock->rows_affected);
                        switch (tds_res)
                        {
                                case TDS_ROWFMT_RESULT:
@@ -494,7 +494,7 @@ class SQLConn : public classbase
        {
                SQLConn* sc = (SQLConn*)pContext->parent;
                LoggingMutex->Lock();
-               sc->Instance->Logs->Log("m_mssql", DEBUG, "Message for DB with id: %s -> %s", sc->host.id.c_str(), pMessage->message);
+               sc->ServerInstance->Logs->Log("m_mssql", DEBUG, "Message for DB with id: %s -> %s", sc->host.id.c_str(), pMessage->message);
                LoggingMutex->Unlock();
                return 0;
        }
@@ -503,7 +503,7 @@ class SQLConn : public classbase
        {
                SQLConn* sc = (SQLConn*)pContext->parent;
                LoggingMutex->Lock();
-               sc->Instance->Logs->Log("m_mssql", DEFAULT, "Error for DB with id: %s -> %s", sc->host.id.c_str(), pMessage->message);
+               sc->ServerInstance->Logs->Log("m_mssql", DEFAULT, "Error for DB with id: %s -> %s", sc->host.id.c_str(), pMessage->message);
                LoggingMutex->Unlock();
                return 0;
        }
index be8598e02c7c8f83369d0b5261b57e5fdb0ff225..2b8c218e8ff14170459bbd90e1d089faaa876e75 100644 (file)
@@ -315,7 +315,7 @@ public:
 class SQLConn : public EventHandler
 {
  private:
-       InspIRCd*               Instance;
+       InspIRCd*               ServerInstance;
        SQLhost                 confhost;       /* The <database> entry */
        Module*                 us;                     /* Pointer to the SQL provider itself */
        PGconn*                 sql;            /* PgSQL database connection handle */
@@ -326,12 +326,12 @@ class SQLConn : public EventHandler
 
  public:
        SQLConn(InspIRCd* SI, Module* self, const SQLhost& hi)
-       : EventHandler(), Instance(SI), confhost(hi), us(self), sql(NULL), status(CWRITE), qinprog(false)
+       : EventHandler(), ServerInstance(SI), confhost(hi), us(self), sql(NULL), status(CWRITE), qinprog(false)
        {
-               idle = this->Instance->Time();
+               idle = this->ServerInstance->Time();
                if(!DoConnect())
                {
-                       Instance->Logs->Log("m_pgsql",DEFAULT, "WARNING: Could not connect to database with id: " + ConvToStr(hi.id));
+                       ServerInstance->Logs->Log("m_pgsql",DEFAULT, "WARNING: Could not connect to database with id: " + ConvToStr(hi.id));
                        DelayReconnect();
                }
        }
@@ -381,9 +381,9 @@ class SQLConn : public EventHandler
                if(this->fd <= -1)
                        return false;
 
-               if (!this->Instance->SE->AddFd(this))
+               if (!this->ServerInstance->SE->AddFd(this))
                {
-                       Instance->Logs->Log("m_pgsql",DEBUG, "BUG: Couldn't add pgsql socket to socket engine");
+                       ServerInstance->Logs->Log("m_pgsql",DEBUG, "BUG: Couldn't add pgsql socket to socket engine");
                        return false;
                }
 
@@ -396,7 +396,7 @@ class SQLConn : public EventHandler
                switch(PQconnectPoll(sql))
                {
                        case PGRES_POLLING_WRITING:
-                               Instance->SE->WantWrite(this);
+                               ServerInstance->SE->WantWrite(this);
                                status = CWRITE;
                                return true;
                        case PGRES_POLLING_READING:
@@ -426,7 +426,7 @@ class SQLConn : public EventHandler
                        /* We just read stuff from the server, that counts as it being alive
                         * so update the idle-since time :p
                         */
-                       idle = this->Instance->Time();
+                       idle = this->ServerInstance->Time();
 
                        if (PQisBusy(sql))
                        {
@@ -509,7 +509,7 @@ class SQLConn : public EventHandler
                switch(PQresetPoll(sql))
                {
                        case PGRES_POLLING_WRITING:
-                               Instance->SE->WantWrite(this);
+                               ServerInstance->SE->WantWrite(this);
                                status = CWRITE;
                                return DoPoll();
                        case PGRES_POLLING_READING:
@@ -621,7 +621,7 @@ class SQLConn : public EventHandler
 #endif
                                                        if(error)
                                                        {
-                                                               Instance->Logs->Log("m_pgsql",DEBUG, "BUG: Apparently PQescapeStringConn() failed somehow...don't know how or what to do...");
+                                                               ServerInstance->Logs->Log("m_pgsql",DEBUG, "BUG: Apparently PQescapeStringConn() failed somehow...don't know how or what to do...");
                                                        }
 
                                                        /* Incremenet queryend to the end of the newly escaped parameter */
@@ -632,7 +632,7 @@ class SQLConn : public EventHandler
                                                }
                                                else
                                                {
-                                                       Instance->Logs->Log("m_pgsql",DEBUG, "BUG: Found a substitution location but no parameter to substitute :|");
+                                                       ServerInstance->Logs->Log("m_pgsql",DEBUG, "BUG: Found a substitution location but no parameter to substitute :|");
                                                        break;
                                                }
                                        }
@@ -690,15 +690,15 @@ class SQLConn : public EventHandler
        }
 
        void Close() {
-               if (!this->Instance->SE->DelFd(this))
+               if (!this->ServerInstance->SE->DelFd(this))
                {
                        if (sql && PQstatus(sql) == CONNECTION_BAD)
                        {
-                               this->Instance->SE->DelFd(this, true);
+                               this->ServerInstance->SE->DelFd(this, true);
                        }
                        else
                        {
-                               Instance->Logs->Log("m_pgsql",DEBUG, "BUG: PQsocket cant be removed from socket engine!");
+                               ServerInstance->Logs->Log("m_pgsql",DEBUG, "BUG: PQsocket cant be removed from socket engine!");
                        }
                }
 
index 5adb9ee93e5d73c3f18ea1ba1845ed08940cc8ac..d76bc97fe72f8891306091f429d3b252b5136396 100644 (file)
@@ -50,7 +50,7 @@ class ResultNotifier : public BufferedSocket
        virtual bool OnDataReady()
        {
                char data = 0;
-               if (Instance->SE->Recv(this, &data, 1, 0) > 0)
+               if (ServerInstance->SE->Recv(this, &data, 1, 0) > 0)
                {
                        Dispatch();
                        return true;
@@ -266,18 +266,18 @@ class SQLConn : public classbase
 {
  private:
        ResultQueue results;
-       InspIRCd* Instance;
+       InspIRCd* ServerInstance;
        Module* mod;
        SQLhost host;
        sqlite3* conn;
 
  public:
        SQLConn(InspIRCd* SI, Module* m, const SQLhost& hi)
-       : Instance(SI), mod(m), host(hi)
+       : ServerInstance(SI), mod(m), host(hi)
        {
                if (OpenDB() != SQLITE_OK)
                {
-                       Instance->Logs->Log("m_sqlite3",DEFAULT, "WARNING: Could not open DB with id: " + host.id);
+                       ServerInstance->Logs->Log("m_sqlite3",DEFAULT, "WARNING: Could not open DB with id: " + host.id);
                        CloseDB();
                }
        }
index eaf6712671ccfb39b73f5996099d4255096aa1ea..f85046fd75713dfcd32696695f0658b4d998b1f9 100644 (file)
@@ -172,7 +172,7 @@ class HttpServerSocket : public BufferedSocket
 
                this->Write(http_version + " "+ConvToStr(response)+" "+Response(response)+"\r\n");
 
-               time_t local = this->Instance->Time();
+               time_t local = this->ServerInstance->Time();
                struct tm *timeinfo = gmtime(&local);
                char *date = asctime(timeinfo);
                date[strlen(date) - 1] = '\0';
@@ -215,7 +215,7 @@ class HttpServerSocket : public BufferedSocket
 
                        if (reqbuffer.length() >= 8192)
                        {
-                               Instance->Logs->Log("m_httpd",DEBUG, "m_httpd dropped connection due to an oversized request buffer");
+                               ServerInstance->Logs->Log("m_httpd",DEBUG, "m_httpd dropped connection due to an oversized request buffer");
                                reqbuffer.clear();
                                return false;
                        }
@@ -321,11 +321,11 @@ class HttpServerSocket : public BufferedSocket
                        claimed = false;
                        HTTPRequest httpr(request_type,uri,&headers,this,this->GetIP(),postdata);
                        Event acl((char*)&httpr, (Module*)HttpModule, "httpd_acl");
-                       acl.Send(this->Instance);
+                       acl.Send(this->ServerInstance);
                        if (!claimed)
                        {
                                Event e((char*)&httpr, (Module*)HttpModule, "httpd_url");
-                               e.Send(this->Instance);
+                               e.Send(this->ServerInstance);
                                if (!claimed)
                                {
                                        SendHTTPError(404);
index dde9f45d3e8f619f1d247660c72e6cc43b0fa812..08f8857974afeec92aed1c3419a964b6b4689ed8 100644 (file)
@@ -24,14 +24,14 @@ bool TreeSocket::AddLine(const std::string &prefix, std::deque<std::string> &par
 {
        if (params.size() < 6)
        {
-               this->Instance->SNO->WriteToSnoMask('x',"%s sent me a malformed ADDLINE of type %s.",prefix.c_str(),params[0].c_str());
+               this->ServerInstance->SNO->WriteToSnoMask('x',"%s sent me a malformed ADDLINE of type %s.",prefix.c_str(),params[0].c_str());
                return true;
        }
 
-       XLineFactory* xlf = Instance->XLines->GetFactory(params[0]);
+       XLineFactory* xlf = ServerInstance->XLines->GetFactory(params[0]);
 
        std::string setter = "<unknown>";
-       User* usr = Instance->FindNick(prefix);
+       User* usr = ServerInstance->FindNick(prefix);
        if (usr)
                setter = usr->nick;
        else
@@ -43,42 +43,42 @@ bool TreeSocket::AddLine(const std::string &prefix, std::deque<std::string> &par
 
        if (!xlf)
        {
-               this->Instance->SNO->WriteToSnoMask('x',"%s sent me an unknown ADDLINE type (%s).",setter.c_str(),params[0].c_str());
+               this->ServerInstance->SNO->WriteToSnoMask('x',"%s sent me an unknown ADDLINE type (%s).",setter.c_str(),params[0].c_str());
                return true;
        }
 
        XLine* xl = NULL;
        try
        {
-               xl = xlf->Generate(Instance->Time(), atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str());
+               xl = xlf->Generate(ServerInstance->Time(), atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str());
        }
        catch (ModuleException &e)
        {
-               this->Instance->SNO->WriteToSnoMask('x',"Unable to ADDLINE type %s from %s: %s", params[0].c_str(), setter.c_str(), e.GetReason());
+               this->ServerInstance->SNO->WriteToSnoMask('x',"Unable to ADDLINE type %s from %s: %s", params[0].c_str(), setter.c_str(), e.GetReason());
                return true;
        }
        xl->SetCreateTime(atoi(params[3].c_str()));
-       if (Instance->XLines->AddLine(xl,NULL))
+       if (ServerInstance->XLines->AddLine(xl,NULL))
        {
                if (xl->duration)
                {
-                       this->Instance->SNO->WriteToSnoMask('x',"%s added %s%s on %s to expire on %s (%s).",setter.c_str(),params[0].c_str(),params[0].length() == 1 ? "LINE" : "",
-                                       params[1].c_str(),Instance->TimeString(xl->expiry).c_str(),params[5].c_str());
+                       this->ServerInstance->SNO->WriteToSnoMask('x',"%s added %s%s on %s to expire on %s (%s).",setter.c_str(),params[0].c_str(),params[0].length() == 1 ? "LINE" : "",
+                                       params[1].c_str(),ServerInstance->TimeString(xl->expiry).c_str(),params[5].c_str());
                }
                else
                {
-                       this->Instance->SNO->WriteToSnoMask('x',"%s added permanent %s%s on %s (%s).",setter.c_str(),params[0].c_str(),params[0].length() == 1 ? "LINE" : "",
+                       this->ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent %s%s on %s (%s).",setter.c_str(),params[0].c_str(),params[0].length() == 1 ? "LINE" : "",
                                        params[1].c_str(),params[5].c_str());
                }
                params[5] = ":" + params[5];
 
-               User* u = Instance->FindNick(prefix);
+               User* u = ServerInstance->FindNick(prefix);
                Utils->DoOneToAllButSender(prefix, "ADDLINE", params, u ? u->server : prefix);
                TreeServer *remoteserver = Utils->FindServer(u ? u->server : prefix);
 
                if (!remoteserver->bursting)
                {
-                       Instance->XLines->ApplyLines();
+                       ServerInstance->XLines->ApplyLines();
                }
        }
        else
index a034d7f52799cee6f3a37a05f678bf631801f0a1..85b5271804bb060b3350c1d01f103c9714490a64 100644 (file)
@@ -25,30 +25,30 @@ bool TreeSocket::Admin(const std::string &prefix, std::deque<std::string> &param
 {
        if (params.size() > 0)
        {
-               if (InspIRCd::Match(this->Instance->Config->ServerName, params[0]))
+               if (InspIRCd::Match(this->ServerInstance->Config->ServerName, params[0]))
                {
                        /* It's for our server */
                        string_list results;
-                       User* source = this->Instance->FindNick(prefix);
+                       User* source = this->ServerInstance->FindNick(prefix);
                        if (source)
                        {
                                std::deque<std::string> par;
                                par.push_back(prefix);
                                par.push_back("");
-                               par[1] = std::string("::")+Instance->Config->ServerName+" 256 "+source->nick+" :Administrative info for "+Instance->Config->ServerName;
-                               Utils->DoOneToOne(this->Instance->Config->GetSID(), "PUSH",par, source->server);
-                               par[1] = std::string("::")+Instance->Config->ServerName+" 257 "+source->nick+" :Name     - "+Instance->Config->AdminName;
-                               Utils->DoOneToOne(this->Instance->Config->GetSID(), "PUSH",par, source->server);
-                               par[1] = std::string("::")+Instance->Config->ServerName+" 258 "+source->nick+" :Nickname - "+Instance->Config->AdminNick;
-                               Utils->DoOneToOne(this->Instance->Config->GetSID(), "PUSH",par, source->server);
-                               par[1] = std::string("::")+Instance->Config->ServerName+" 258 "+source->nick+" :E-Mail   - "+Instance->Config->AdminEmail;
-                               Utils->DoOneToOne(this->Instance->Config->GetSID(), "PUSH",par, source->server);
+                               par[1] = std::string("::")+ServerInstance->Config->ServerName+" 256 "+source->nick+" :Administrative info for "+ServerInstance->Config->ServerName;
+                               Utils->DoOneToOne(this->ServerInstance->Config->GetSID(), "PUSH",par, source->server);
+                               par[1] = std::string("::")+ServerInstance->Config->ServerName+" 257 "+source->nick+" :Name     - "+ServerInstance->Config->AdminName;
+                               Utils->DoOneToOne(this->ServerInstance->Config->GetSID(), "PUSH",par, source->server);
+                               par[1] = std::string("::")+ServerInstance->Config->ServerName+" 258 "+source->nick+" :Nickname - "+ServerInstance->Config->AdminNick;
+                               Utils->DoOneToOne(this->ServerInstance->Config->GetSID(), "PUSH",par, source->server);
+                               par[1] = std::string("::")+ServerInstance->Config->ServerName+" 258 "+source->nick+" :E-Mail   - "+ServerInstance->Config->AdminEmail;
+                               Utils->DoOneToOne(this->ServerInstance->Config->GetSID(), "PUSH",par, source->server);
                        }
                }
                else
                {
                        /* Pass it on */
-                       User* source = this->Instance->FindNick(prefix);
+                       User* source = this->ServerInstance->FindNick(prefix);
                        if (source)
                                Utils->DoOneToOne(prefix, "ADMIN", params, params[0]);
                }
index 8037907d07249b9cc6bc251eefe41136aed8b3a1..8b02b954526f5d61bb553522777fd04598771543 100644 (file)
@@ -24,7 +24,7 @@
 
 std::string TreeSocket::MyCapabilities()
 {
-       std::vector<std::string> modlist = this->Instance->Modules->GetAllModuleNames(VF_COMMON);
+       std::vector<std::string> modlist = this->ServerInstance->Modules->GetAllModuleNames(VF_COMMON);
        std::string capabilities;
        sort(modlist.begin(),modlist.end());
        for (unsigned int i = 0; i < modlist.size(); i++)
@@ -74,28 +74,28 @@ void TreeSocket::SendCapabilities()
 #endif
        std::string extra;
        /* Do we have sha256 available? If so, we send a challenge */
-       if (Utils->ChallengeResponse && (Instance->Modules->Find("m_sha256.so")))
+       if (Utils->ChallengeResponse && (ServerInstance->Modules->Find("m_sha256.so")))
        {
                this->SetOurChallenge(RandString(20));
                extra = " CHALLENGE=" + this->GetOurChallenge();
        }
 
        this->WriteLine("CAPAB CAPABILITIES " /* Preprocessor does this one. */
-                       ":NICKMAX="+ConvToStr(Instance->Config->Limits.NickMax)+
-                       " HALFOP="+ConvToStr(Instance->Config->AllowHalfop)+
-                       " CHANMAX="+ConvToStr(Instance->Config->Limits.ChanMax)+
-                       " MAXMODES="+ConvToStr(Instance->Config->Limits.MaxModes)+
-                       " IDENTMAX="+ConvToStr(Instance->Config->Limits.IdentMax)+
-                       " MAXQUIT="+ConvToStr(Instance->Config->Limits.MaxQuit)+
-                       " MAXTOPIC="+ConvToStr(Instance->Config->Limits.MaxTopic)+
-                       " MAXKICK="+ConvToStr(Instance->Config->Limits.MaxKick)+
-                       " MAXGECOS="+ConvToStr(Instance->Config->Limits.MaxGecos)+
-                       " MAXAWAY="+ConvToStr(Instance->Config->Limits.MaxAway)+
+                       ":NICKMAX="+ConvToStr(ServerInstance->Config->Limits.NickMax)+
+                       " HALFOP="+ConvToStr(ServerInstance->Config->AllowHalfop)+
+                       " CHANMAX="+ConvToStr(ServerInstance->Config->Limits.ChanMax)+
+                       " MAXMODES="+ConvToStr(ServerInstance->Config->Limits.MaxModes)+
+                       " IDENTMAX="+ConvToStr(ServerInstance->Config->Limits.IdentMax)+
+                       " MAXQUIT="+ConvToStr(ServerInstance->Config->Limits.MaxQuit)+
+                       " MAXTOPIC="+ConvToStr(ServerInstance->Config->Limits.MaxTopic)+
+                       " MAXKICK="+ConvToStr(ServerInstance->Config->Limits.MaxKick)+
+                       " MAXGECOS="+ConvToStr(ServerInstance->Config->Limits.MaxGecos)+
+                       " MAXAWAY="+ConvToStr(ServerInstance->Config->Limits.MaxAway)+
                        " IP6NATIVE="+ConvToStr(ip6)+
                        " IP6SUPPORT="+ConvToStr(ip6support)+
                        " PROTOCOL="+ConvToStr(ProtocolVersion)+extra+
-                       " PREFIX="+Instance->Modes->BuildPrefixes()+
-                       " CHANMODES="+Instance->Modes->ChanModes()+
+                       " PREFIX="+ServerInstance->Modes->BuildPrefixes()+
+                       " CHANMODES="+ServerInstance->Modes->ChanModes()+
                        " SVSPART=1");
 
        this->WriteLine("CAPAB END");
@@ -183,23 +183,23 @@ bool TreeSocket::Capab(const std::deque<std::string> &params)
                                reason = "Protocol version not specified";
                }
 
-               if(this->CapKeys.find("PREFIX") != this->CapKeys.end() && this->CapKeys.find("PREFIX")->second != this->Instance->Modes->BuildPrefixes())
+               if(this->CapKeys.find("PREFIX") != this->CapKeys.end() && this->CapKeys.find("PREFIX")->second != this->ServerInstance->Modes->BuildPrefixes())
                        reason = "One or more of the prefixes on the remote server are invalid on this server.";
 
-               if (((this->CapKeys.find("HALFOP") == this->CapKeys.end()) && (Instance->Config->AllowHalfop)) || ((this->CapKeys.find("HALFOP") != this->CapKeys.end()) && (this->CapKeys.find("HALFOP")->second != ConvToStr(Instance->Config->AllowHalfop))))
+               if (((this->CapKeys.find("HALFOP") == this->CapKeys.end()) && (ServerInstance->Config->AllowHalfop)) || ((this->CapKeys.find("HALFOP") != this->CapKeys.end()) && (this->CapKeys.find("HALFOP")->second != ConvToStr(ServerInstance->Config->AllowHalfop))))
                        reason = "We don't both have halfop support enabled/disabled identically";
 
                /* Challenge response, store their challenge for our password */
                std::map<std::string,std::string>::iterator n = this->CapKeys.find("CHALLENGE");
-               if (Utils->ChallengeResponse && (n != this->CapKeys.end()) && (Instance->Modules->Find("m_sha256.so")))
+               if (Utils->ChallengeResponse && (n != this->CapKeys.end()) && (ServerInstance->Modules->Find("m_sha256.so")))
                {
                        /* Challenge-response is on now */
                        this->SetTheirChallenge(n->second);
                        if (!this->GetTheirChallenge().empty() && (this->LinkState == CONNECTING))
                        {
                                this->SendCapabilities();
-                               this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+this->MakePass(OutboundPass, this->GetTheirChallenge())+" 0 "+
-                                               Instance->Config->GetSID()+" :"+this->Instance->Config->ServerDesc);
+                               this->WriteLine(std::string("SERVER ")+this->ServerInstance->Config->ServerName+" "+this->MakePass(OutboundPass, this->GetTheirChallenge())+" 0 "+
+                                               ServerInstance->Config->GetSID()+" :"+this->ServerInstance->Config->ServerDesc);
                        }
                }
                else
@@ -208,7 +208,7 @@ bool TreeSocket::Capab(const std::deque<std::string> &params)
                        if (this->LinkState == CONNECTING)
                        {
                                this->SendCapabilities();
-                               this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+OutboundPass+" 0 "+Instance->Config->GetSID()+" :"+this->Instance->Config->ServerDesc);
+                               this->WriteLine(std::string("SERVER ")+this->ServerInstance->Config->ServerName+" "+OutboundPass+" 0 "+ServerInstance->Config->GetSID()+" :"+this->ServerInstance->Config->ServerDesc);
                        }
                }
 
index e8c398f6be204740dce1c16eeab63c2a193d7420..980573df47fd7f90e7f7e6a5ccddb85496eab997 100644 (file)
@@ -28,7 +28,7 @@ bool TreeSocket::DelLine(const std::string &prefix, std::deque<std::string> &par
 
        std::string setter = "<unknown>";
 
-       User* user = Instance->FindNick(prefix);
+       User* user = ServerInstance->FindNick(prefix);
        if (user)
                setter = user->nick;
        else
@@ -40,9 +40,9 @@ bool TreeSocket::DelLine(const std::string &prefix, std::deque<std::string> &par
 
 
        /* NOTE: No check needed on 'user', this function safely handles NULL */
-       if (Instance->XLines->DelLine(params[1].c_str(), params[0], user))
+       if (ServerInstance->XLines->DelLine(params[1].c_str(), params[0], user))
        {
-               this->Instance->SNO->WriteToSnoMask('x',"%s removed %s%s on %s.", setter.c_str(),
+               this->ServerInstance->SNO->WriteToSnoMask('x',"%s removed %s%s on %s.", setter.c_str(),
                                params[0].c_str(), params[0].length() == 1 ? "LINE" : "", params[1].c_str());
                Utils->DoOneToAllButSender(prefix,"DELLINE", params, prefix);
        }
index 02233e91678cc51db1bcadec52ca1d49d7742b25..3bafe5b2f8e0d07a7c9b6d0b956949596d8f9393 100644 (file)
@@ -27,10 +27,10 @@ bool TreeSocket::Encap(const std::string &prefix, std::deque<std::string> &param
 {
        if (params.size() > 1)
        {
-               if (InspIRCd::Match(Instance->Config->GetSID(), params[0]))
+               if (InspIRCd::Match(ServerInstance->Config->GetSID(), params[0]))
                {
                        Event event((char*) &params, (Module*)this->Utils->Creator, "encap_received");
-                       event.Send(Instance);
+                       event.Send(ServerInstance);
                }
 
                if (params[0].find('*') != std::string::npos)
index 09b660ac87ccc29b7153490972bf5420b16a53f7..a4aa5abd6dc5fb8fefdda1820aa2666bceb4305b 100644 (file)
@@ -25,7 +25,7 @@ bool TreeSocket::ChangeHost(const std::string &prefix, std::deque<std::string> &
 {
        if (params.size() < 1)
                return true;
-       User* u = this->Instance->FindNick(prefix);
+       User* u = this->ServerInstance->FindNick(prefix);
 
        if (u)
        {
index b891443ea1d1404a0606f83d1c2e3afe3c83e989..fa61cea4a055ea078615ca0889319a717c2ac436 100644 (file)
@@ -60,14 +60,14 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
        if (params.size() < 3)
                return true;
 
-       irc::modestacker modestack(Instance, true);                     /* Modes to apply from the users in the user list */
+       irc::modestacker modestack(ServerInstance, true);                       /* Modes to apply from the users in the user list */
        User* who = NULL;                                               /* User we are currently checking */
        std::string channel = params[0];                                /* Channel name, as a string */
        time_t TS = atoi(params[1].c_str());                            /* Timestamp given to us for remote side */
        irc::tokenstream users((params.size() > 3) ? params[params.size() - 1] : "");   /* users from the user list */
        bool apply_other_sides_modes = true;                            /* True if we are accepting the other side's modes */
-       Channel* chan = this->Instance->FindChan(channel);              /* The channel we're sending joins to */
-       time_t ourTS = chan ? chan->age : Instance->Time()+600; /* The TS of our side of the link */
+       Channel* chan = this->ServerInstance->FindChan(channel);                /* The channel we're sending joins to */
+       time_t ourTS = chan ? chan->age : ServerInstance->Time()+600;   /* The TS of our side of the link */
        bool created = !chan;                                           /* True if the channel doesnt exist here yet */
        std::string item;                                               /* One item in the list of nicks */
 
@@ -78,13 +78,13 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
 
        if (!TS)
        {
-               Instance->Logs->Log("m_spanningtree",DEFAULT,"*** BUG? *** TS of 0 sent to FJOIN. Are some services authors smoking craq, or is it 1970 again?. Dropped.");
-               Instance->SNO->WriteToSnoMask('d', "WARNING: The server %s is sending FJOIN with a TS of zero. Total craq. Command was dropped.", source.c_str());
+               ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"*** BUG? *** TS of 0 sent to FJOIN. Are some services authors smoking craq, or is it 1970 again?. Dropped.");
+               ServerInstance->SNO->WriteToSnoMask('d', "WARNING: The server %s is sending FJOIN with a TS of zero. Total craq. Command was dropped.", source.c_str());
                return true;
        }
 
        if (created)
-               chan = new Channel(Instance, channel, ourTS);
+               chan = new Channel(ServerInstance, channel, ourTS);
 
        /* If our TS is less than theirs, we dont accept their modes */
        if (ourTS < TS)
@@ -95,13 +95,13 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
        {
                std::deque<std::string> param_list;
                if (Utils->AnnounceTSChange && chan)
-                       chan->WriteChannelWithServ(Instance->Config->ServerName, "NOTICE %s :TS for %s changed from %lu to %lu", chan->name.c_str(), chan->name.c_str(), (unsigned long) ourTS, (unsigned long) TS);
+                       chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :TS for %s changed from %lu to %lu", chan->name.c_str(), chan->name.c_str(), (unsigned long) ourTS, (unsigned long) TS);
                ourTS = TS;
                if (!created)
                {
                        chan->age = TS;
                        param_list.push_back(channel);
-                       this->RemoveStatus(Instance->Config->GetSID(), param_list);
+                       this->RemoveStatus(ServerInstance->Config->GetSID(), param_list);
                }
        }
 
@@ -120,7 +120,7 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
                        modelist.push_back(params[idx]);
                }
 
-               this->Instance->SendMode(modelist, this->Instance->FakeClient);
+               this->ServerInstance->SendMode(modelist, this->ServerInstance->FakeClient);
        }
 
        /* Now, process every 'modes,nick' pair */
@@ -136,7 +136,7 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
                        /* Iterate through all modes for this user and check they are valid. */
                        while ((*unparsedmodes) && (*unparsedmodes != ','))
                        {
-                               ModeHandler *mh = Instance->Modes->FindMode(*unparsedmodes, MODETYPE_CHANNEL);
+                               ModeHandler *mh = ServerInstance->Modes->FindMode(*unparsedmodes, MODETYPE_CHANNEL);
                                if (mh)
                                        modes += *unparsedmodes;
                                else
@@ -153,7 +153,7 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
                        usr++;
 
                        /* Check the user actually exists */
-                       who = this->Instance->FindUUID(usr);
+                       who = this->ServerInstance->FindUUID(usr);
                        if (who)
                        {
                                /* Check that the user's 'direction' is correct */
@@ -165,11 +165,11 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
                                for (std::string::iterator x = modes.begin(); x != modes.end(); ++x)
                                        modestack.Push(*x, who->nick);
 
-                               Channel::JoinUser(this->Instance, who, channel.c_str(), true, "", true, TS);
+                               Channel::JoinUser(this->ServerInstance, who, channel.c_str(), true, "", true, TS);
                        }
                        else
                        {
-                               Instance->Logs->Log("m_spanningtree",SPARSE, "Ignored nonexistant user %s in fjoin to %s (probably quit?)", usr, channel.c_str());
+                               ServerInstance->Logs->Log("m_spanningtree",SPARSE, "Ignored nonexistant user %s in fjoin to %s (probably quit?)", usr, channel.c_str());
                                continue;
                        }
                }
@@ -188,7 +188,7 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
                        {
                                mode_junk.push_back(stackresult[j]);
                        }
-                       Instance->SendMode(mode_junk, Instance->FakeClient);
+                       ServerInstance->SendMode(mode_junk, ServerInstance->FakeClient);
                }
        }
 
@@ -202,18 +202,18 @@ bool TreeSocket::RemoveStatus(const std::string &prefix, std::deque<std::string>
        if (params.size() < 1)
                return true;
 
-       Channel* c = Instance->FindChan(params[0]);
+       Channel* c = ServerInstance->FindChan(params[0]);
 
        if (c)
        {
-               irc::modestacker stack(Instance, false);
+               irc::modestacker stack(ServerInstance, false);
                std::deque<std::string> stackresult;
                std::vector<std::string> mode_junk;
                mode_junk.push_back(c->name);
 
                for (char modeletter = 'A'; modeletter <= 'z'; ++modeletter)
                {
-                       ModeHandler* mh = Instance->Modes->FindMode(modeletter, MODETYPE_CHANNEL);
+                       ModeHandler* mh = ServerInstance->Modes->FindMode(modeletter, MODETYPE_CHANNEL);
 
                        /* Passing a pointer to a modestacker here causes the mode to be put onto the mode stack,
                         * rather than applied immediately. Module unloads require this to be done immediately,
@@ -228,7 +228,7 @@ bool TreeSocket::RemoveStatus(const std::string &prefix, std::deque<std::string>
                        for (size_t j = 0; j < stackresult.size(); j++)
                                mode_junk.push_back(stackresult[j]);
 
-                       Instance->SendMode(mode_junk, Instance->FakeClient);
+                       ServerInstance->SendMode(mode_junk, ServerInstance->FakeClient);
                }
        }
        return true;
index 2ab37017079131d6d257453c9664df87418760fa..d8e2342d536025f85353dd6307a7dfbff3556783 100644 (file)
@@ -35,7 +35,7 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
        std::string sourceserv;
 
        /* Are we dealing with an FMODE from a user, or from a server? */
-       User* who = this->Instance->FindNick(source);
+       User* who = this->ServerInstance->FindNick(source);
        if (who)
        {
                /* FMODE from a user, set sourceserv to the users server name */
@@ -44,7 +44,7 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
        else
        {
                /* FMODE from a server, use a fake user to receive mode feedback */
-               who = this->Instance->FakeClient;
+               who = this->ServerInstance->FakeClient;
                smode = true;                   /* Setting this flag tells us it is a server mode*/
                sourceserv = source;    /* Set sourceserv to the actual source string */
        }
@@ -68,7 +68,7 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
 
        }
        /* Extract the TS value of the object, either User or Channel */
-       User* dst = this->Instance->FindNick(params[0]);
+       User* dst = this->ServerInstance->FindNick(params[0]);
        Channel* chan = NULL;
        time_t ourTS = 0;
 
@@ -78,7 +78,7 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
        }
        else
        {
-               chan = this->Instance->FindChan(params[0]);
+               chan = this->ServerInstance->FindChan(params[0]);
                if (chan)
                {
                        ourTS = chan->age;
@@ -90,8 +90,8 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
 
        if (!TS)
        {
-               Instance->Logs->Log("m_spanningtree",DEFAULT,"*** BUG? *** TS of 0 sent to FMODE. Are some services authors smoking craq, or is it 1970 again?. Dropped.");
-               Instance->SNO->WriteToSnoMask('d', "WARNING: The server %s is sending FMODE with a TS of zero. Total craq. Mode was dropped.", sourceserv.c_str());
+               ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"*** BUG? *** TS of 0 sent to FMODE. Are some services authors smoking craq, or is it 1970 again?. Dropped.");
+               ServerInstance->SNO->WriteToSnoMask('d', "WARNING: The server %s is sending FMODE with a TS of zero. Total craq. Mode was dropped.", sourceserv.c_str());
                return true;
        }
 
@@ -101,11 +101,11 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
        {
                if (smode)
                {
-                       this->Instance->SendMode(modelist, who);
+                       this->ServerInstance->SendMode(modelist, who);
                }
                else
                {
-                       this->Instance->CallCommandHandler("MODE", modelist, who);
+                       this->ServerInstance->CallCommandHandler("MODE", modelist, who);
                }
                /* HOT POTATO! PASS IT ON! */
                Utils->DoOneToAllButSender(source,"FMODE",params,sourceserv);
index 8d2f137a506f51c98c3edc875720bc0cf8a8531b..ddbc79660c36618c98904574437421330e17f0ad 100644 (file)
@@ -25,7 +25,7 @@ bool TreeSocket::ChangeName(const std::string &prefix, std::deque<std::string> &
 {
        if (params.size() < 1)
                return true;
-       User* u = this->Instance->FindNick(prefix);
+       User* u = this->ServerInstance->FindNick(prefix);
        if (u)
        {
                u->ChangeName(params[0].c_str());
index 2ed813b0f8cdb7f4f4e630cad987400181adeaee..351c4327a4c68f8ff2e3a1745d5a08b5134c13f1 100644 (file)
@@ -27,19 +27,19 @@ bool TreeSocket::ForceTopic(const std::string &source, std::deque<std::string> &
        if (params.size() != 4)
                return true;
        time_t ts = atoi(params[1].c_str());
-       Channel* c = this->Instance->FindChan(params[0]);
+       Channel* c = this->ServerInstance->FindChan(params[0]);
        if (c)
        {
                if ((ts >= c->topicset) || (c->topic.empty()))
                {
                        if (c->topic != params[3])
                        {
-                               User* user = this->Instance->FindNick(source);
+                               User* user = this->ServerInstance->FindNick(source);
                                // Update topic only when it differs from current topic
-                               c->topic.assign(params[3], 0, Instance->Config->Limits.MaxTopic);
+                               c->topic.assign(params[3], 0, ServerInstance->Config->Limits.MaxTopic);
                                if (!user)
                                {
-                                       c->WriteChannelWithServ(Instance->Config->ServerName, "TOPIC %s :%s", c->name.c_str(), c->topic.c_str());
+                                       c->WriteChannelWithServ(ServerInstance->Config->ServerName, "TOPIC %s :%s", c->name.c_str(), c->topic.c_str());
                                }
                                else
                                {
index 418a64724bc7fbcac3b7e8966e0b94471d581064..2e81dcc54840a2dad820d68f4b23b53cd0b3c316 100644 (file)
@@ -58,7 +58,7 @@ std::string TreeSocket::MakePass(const std::string &password, const std::string
         * Note: If m_sha256.so is not loaded, we MUST fall back to plaintext with no
         *       HMAC challenge/response.
         */
-       Module* sha256 = Instance->Modules->Find("m_sha256.so");
+       Module* sha256 = ServerInstance->Modules->Find("m_sha256.so");
        if (Utils->ChallengeResponse && sha256 && !challenge.empty())
        {
                /* XXX: This is how HMAC is supposed to be done:
@@ -89,7 +89,7 @@ std::string TreeSocket::MakePass(const std::string &password, const std::string
                return "HMAC-SHA256:"+ hmac;
        }
        else if (!challenge.empty() && !sha256)
-               Instance->Logs->Log("m_spanningtree",DEFAULT,"Not authenticating to server using SHA256/HMAC because we don't have m_sha256 loaded!");
+               ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Not authenticating to server using SHA256/HMAC because we don't have m_sha256 loaded!");
 
        return password;
 }
@@ -108,7 +108,7 @@ std::string TreeSocket::RandString(unsigned int ilength)
        {
 #ifndef WINDOWS
                if (read(f, randombuf, ilength) < 1)
-                       Instance->Logs->Log("m_spanningtree", DEFAULT, "There are crack smoking monkeys in your kernel (in other words, nonblocking /dev/urandom blocked.)");
+                       ServerInstance->Logs->Log("m_spanningtree", DEFAULT, "There are crack smoking monkeys in your kernel (in other words, nonblocking /dev/urandom blocked.)");
                close(f);
 #endif
        }
@@ -135,7 +135,7 @@ bool TreeSocket::ComparePass(const std::string &ours, const std::string &theirs)
                /* One or both of us specified hmac sha256, but we don't have sha256 module loaded!
                 * We can't allow this password as valid.
                  */
-               if (!Instance->Modules->Find("m_sha256.so") || !Utils->ChallengeResponse)
+               if (!ServerInstance->Modules->Find("m_sha256.so") || !Utils->ChallengeResponse)
                        return false;
                else
                        /* Straight string compare of hashes */
index 93bed9bbea58d9a245f9e7733a455ab5ff542c34..c70ce27cb116c881e64c067433726ce73d992046 100644 (file)
@@ -28,7 +28,7 @@ bool TreeSocket::RemoteKill(const std::string &prefix, std::deque<std::string> &
        if (params.size() != 2)
                return true;
 
-       User* who = this->Instance->FindNick(params[0]);
+       User* who = this->ServerInstance->FindNick(params[0]);
 
        if (who)
        {
@@ -44,7 +44,7 @@ bool TreeSocket::RemoteKill(const std::string &prefix, std::deque<std::string> &
                // NOTE: This is safe with kill hiding on, as RemoteKill is only reached if we have a server prefix.
                // in short this is not executed for USERS.
                who->Write(":%s KILL %s :%s (%s)", prefix.c_str(), who->nick.c_str(), prefix.c_str(), reason.c_str());
-               this->Instance->Users->QuitUser(who, reason);
+               this->ServerInstance->Users->QuitUser(who, reason);
        }
        return true;
 }
index 5c64d257c3733abd732da807bc6cfa1f2a22cc14..9cdce5eb78fcb0e7b1548403306126ddd0b45182 100644 (file)
@@ -32,22 +32,22 @@ bool TreeSocket::MetaData(const std::string &prefix, std::deque<std::string> &pa
        {
                if (params[0] == "*")
                {
-                       FOREACH_MOD_I(this->Instance,I_OnDecodeMetaData,OnDecodeMetaData(TYPE_OTHER,NULL,params[1],params[2]));
+                       FOREACH_MOD_I(this->ServerInstance,I_OnDecodeMetaData,OnDecodeMetaData(TYPE_OTHER,NULL,params[1],params[2]));
                }
                else if (*(params[0].c_str()) == '#')
                {
-                       Channel* c = this->Instance->FindChan(params[0]);
+                       Channel* c = this->ServerInstance->FindChan(params[0]);
                        if (c)
                        {
-                               FOREACH_MOD_I(this->Instance,I_OnDecodeMetaData,OnDecodeMetaData(TYPE_CHANNEL,c,params[1],params[2]));
+                               FOREACH_MOD_I(this->ServerInstance,I_OnDecodeMetaData,OnDecodeMetaData(TYPE_CHANNEL,c,params[1],params[2]));
                        }
                }
                else if (*(params[0].c_str()) != '#')
                {
-                       User* u = this->Instance->FindNick(params[0]);
+                       User* u = this->ServerInstance->FindNick(params[0]);
                        if (u)
                        {
-                               FOREACH_MOD_I(this->Instance,I_OnDecodeMetaData,OnDecodeMetaData(TYPE_USER,u,params[1],params[2]));
+                               FOREACH_MOD_I(this->ServerInstance,I_OnDecodeMetaData,OnDecodeMetaData(TYPE_USER,u,params[1],params[2]));
                        }
                }
        }
index fe6ca8434ec8e38e4207dfd1484f01769acc5c0f..a785a3f5100075b52dcac985a34afbd83b1ef13f 100644 (file)
@@ -26,7 +26,7 @@ bool TreeSocket::Modules(const std::string &prefix, std::deque<std::string> &par
        if (params.empty())
                return true;
 
-       if (!InspIRCd::Match(this->Instance->Config->ServerName, params[0]))
+       if (!InspIRCd::Match(this->ServerInstance->Config->ServerName, params[0]))
        {
                /* Pass it on, not for us */
                Utils->DoOneToOne(prefix, "MODULES", params, params[0]);
@@ -38,15 +38,15 @@ bool TreeSocket::Modules(const std::string &prefix, std::deque<std::string> &par
        par.push_back(prefix);
        par.push_back("");
 
-       User* source = this->Instance->FindNick(prefix);
+       User* source = this->ServerInstance->FindNick(prefix);
        if (!source)
                return true;
 
-       std::vector<std::string> module_names = Instance->Modules->GetAllModuleNames(0);
+       std::vector<std::string> module_names = ServerInstance->Modules->GetAllModuleNames(0);
 
        for (unsigned int i = 0; i < module_names.size(); i++)
        {
-               Module* m = Instance->Modules->Find(module_names[i]);
+               Module* m = ServerInstance->Modules->Find(module_names[i]);
                Version V = m->GetVersion();
 
                if (IS_OPER(source))
@@ -57,18 +57,18 @@ bool TreeSocket::Modules(const std::string &prefix, std::deque<std::string> &par
                                if (!(V.Flags & mult))
                                        flags[pos] = '-';
 
-                       snprintf(strbuf, MAXBUF, "::%s 702 %s :0x%08lx %s %s :%s", Instance->Config->ServerName, source->nick.c_str(),(unsigned long)m, module_names[i].c_str(), flags.c_str(), V.version.c_str());
+                       snprintf(strbuf, MAXBUF, "::%s 702 %s :0x%08lx %s %s :%s", ServerInstance->Config->ServerName, source->nick.c_str(),(unsigned long)m, module_names[i].c_str(), flags.c_str(), V.version.c_str());
                }
                else
                {
-                       snprintf(strbuf, MAXBUF, "::%s 702 %s :%s", Instance->Config->ServerName, source->nick.c_str(), module_names[i].c_str());
+                       snprintf(strbuf, MAXBUF, "::%s 702 %s :%s", ServerInstance->Config->ServerName, source->nick.c_str(), module_names[i].c_str());
                }
                par[1] = strbuf;
-               Utils->DoOneToOne(Instance->Config->GetSID(), "PUSH", par, source->server);
+               Utils->DoOneToOne(ServerInstance->Config->GetSID(), "PUSH", par, source->server);
        }
-       snprintf(strbuf, MAXBUF, "::%s 703 %s :End of MODULES list", Instance->Config->ServerName, source->nick.c_str());
+       snprintf(strbuf, MAXBUF, "::%s 703 %s :End of MODULES list", ServerInstance->Config->ServerName, source->nick.c_str());
        par[1] = strbuf;
-       Utils->DoOneToOne(Instance->Config->GetSID(), "PUSH", par, source->server);
+       Utils->DoOneToOne(ServerInstance->Config->GetSID(), "PUSH", par, source->server);
        return true;
 }
 
index 6ec09c5fd2a574673982da5b9a0321de89f51ae5..f16e3c29efcd0867af49601118a48906df90f0b6 100644 (file)
@@ -27,11 +27,11 @@ bool TreeSocket::Motd(const std::string &prefix, std::deque<std::string> &params
 {
        if (params.size() > 0)
        {
-               if (InspIRCd::Match(this->Instance->Config->ServerName, params[0]))
+               if (InspIRCd::Match(this->ServerInstance->Config->ServerName, params[0]))
                {
                        /* It's for our server */
                        string_list results;
-                       User* source = this->Instance->FindNick(prefix);
+                       User* source = this->ServerInstance->FindNick(prefix);
 
                        if (source)
                        {
@@ -39,30 +39,30 @@ bool TreeSocket::Motd(const std::string &prefix, std::deque<std::string> &params
                                par.push_back(prefix);
                                par.push_back("");
 
-                               if (!Instance->Config->MOTD.size())
+                               if (!ServerInstance->Config->MOTD.size())
                                {
-                                       par[1] = std::string("::")+Instance->Config->ServerName+" 422 "+source->nick+" :Message of the day file is missing.";
-                                       Utils->DoOneToOne(this->Instance->Config->GetSID(), "PUSH",par, source->server);
+                                       par[1] = std::string("::")+ServerInstance->Config->ServerName+" 422 "+source->nick+" :Message of the day file is missing.";
+                                       Utils->DoOneToOne(this->ServerInstance->Config->GetSID(), "PUSH",par, source->server);
                                        return true;
                                }
 
-                               par[1] = std::string("::")+Instance->Config->ServerName+" 375 "+source->nick+" :"+Instance->Config->ServerName+" message of the day";
-                               Utils->DoOneToOne(this->Instance->Config->GetSID(), "PUSH",par, source->server);
+                               par[1] = std::string("::")+ServerInstance->Config->ServerName+" 375 "+source->nick+" :"+ServerInstance->Config->ServerName+" message of the day";
+                               Utils->DoOneToOne(this->ServerInstance->Config->GetSID(), "PUSH",par, source->server);
 
-                               for (unsigned int i = 0; i < Instance->Config->MOTD.size(); i++)
+                               for (unsigned int i = 0; i < ServerInstance->Config->MOTD.size(); i++)
                                {
-                                       par[1] = std::string("::")+Instance->Config->ServerName+" 372 "+source->nick+" :- "+Instance->Config->MOTD[i];
-                                       Utils->DoOneToOne(this->Instance->Config->GetSID(), "PUSH",par, source->server);
+                                       par[1] = std::string("::")+ServerInstance->Config->ServerName+" 372 "+source->nick+" :- "+ServerInstance->Config->MOTD[i];
+                                       Utils->DoOneToOne(this->ServerInstance->Config->GetSID(), "PUSH",par, source->server);
                                }
 
-                               par[1] = std::string("::")+Instance->Config->ServerName+" 376 "+source->nick+" :End of message of the day.";
-                               Utils->DoOneToOne(this->Instance->Config->GetSID(), "PUSH",par, source->server);
+                               par[1] = std::string("::")+ServerInstance->Config->ServerName+" 376 "+source->nick+" :End of message of the day.";
+                               Utils->DoOneToOne(this->ServerInstance->Config->GetSID(), "PUSH",par, source->server);
                        }
                }
                else
                {
                        /* Pass it on */
-                       User* source = this->Instance->FindNick(prefix);
+                       User* source = this->ServerInstance->FindNick(prefix);
                        if (source)
                                Utils->DoOneToOne(prefix, "MOTD", params, params[0]);
                }
index 6d068c5e2e1dbbcaa198f1fccf3df555026627a4..b97c582d0b2fca9b29ca4baaea0b3f5428eeeaf4 100644 (file)
 void TreeSocket::DoBurst(TreeServer* s)
 {
        std::string name = s->GetName();
-       std::string burst = ":" + this->Instance->Config->GetSID() + " BURST " +ConvToStr(Instance->Time());
-       std::string endburst = ":" + this->Instance->Config->GetSID() + " ENDBURST";
-       this->Instance->SNO->WriteToSnoMask('l',"Bursting to \2%s\2 (Authentication: %s).", name.c_str(), this->GetTheirChallenge().empty() ? "plaintext password" : "SHA256-HMAC challenge-response");
+       std::string burst = ":" + this->ServerInstance->Config->GetSID() + " BURST " +ConvToStr(ServerInstance->Time());
+       std::string endburst = ":" + this->ServerInstance->Config->GetSID() + " ENDBURST";
+       this->ServerInstance->SNO->WriteToSnoMask('l',"Bursting to \2%s\2 (Authentication: %s).", name.c_str(), this->GetTheirChallenge().empty() ? "plaintext password" : "SHA256-HMAC challenge-response");
        this->WriteLine(burst);
        /* send our version string */
-       this->WriteLine(std::string(":")+this->Instance->Config->GetSID()+" VERSION :"+this->Instance->GetVersionString());
+       this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" VERSION :"+this->ServerInstance->GetVersionString());
        /* Send server tree */
        this->SendServers(Utils->TreeRoot,s,1);
        /* Send users and their oper status */
@@ -42,9 +42,9 @@ void TreeSocket::DoBurst(TreeServer* s)
        /* Send everything else (channel modes, xlines etc) */
        this->SendChannelModes(s);
        this->SendXLines(s);
-       FOREACH_MOD_I(this->Instance,I_OnSyncOtherMetaData,OnSyncOtherMetaData((Module*)Utils->Creator,(void*)this));
+       FOREACH_MOD_I(this->ServerInstance,I_OnSyncOtherMetaData,OnSyncOtherMetaData((Module*)Utils->Creator,(void*)this));
        this->WriteLine(endburst);
-       this->Instance->SNO->WriteToSnoMask('l',"Finished bursting to \2"+name+"\2.");
+       this->ServerInstance->SNO->WriteToSnoMask('l',"Finished bursting to \2"+name+"\2.");
 }
 
 /** Recursively send the server tree with distances as hops.
@@ -85,7 +85,7 @@ void TreeSocket::SendFJoins(TreeServer* Current, Channel* c)
        char list[MAXBUF];
 
        size_t dlen, curlen;
-       dlen = curlen = snprintf(list,MAXBUF,":%s FJOIN %s %lu +%s", this->Instance->Config->GetSID().c_str(), c->name.c_str(),(unsigned long)c->age, c->ChanModes(true));
+       dlen = curlen = snprintf(list,MAXBUF,":%s FJOIN %s %lu +%s", this->ServerInstance->Config->GetSID().c_str(), c->name.c_str(),(unsigned long)c->age, c->ChanModes(true));
        int numusers = 0;
        char* ptr = list + dlen;
        bool looped_once = false;
@@ -97,12 +97,12 @@ void TreeSocket::SendFJoins(TreeServer* Current, Channel* c)
        for (CUList::iterator i = ulist->begin(); i != ulist->end(); i++)
        {
                size_t ptrlen = 0;
-               std::string modestr = this->Instance->Modes->ModeString(i->first, c, false);
+               std::string modestr = this->ServerInstance->Modes->ModeString(i->first, c, false);
 
                if ((curlen + modestr.length() + i->first->uuid.length() + 4) > 480)
                {
                        buffer.append(list).append("\r\n");
-                       dlen = curlen = snprintf(list, MAXBUF, ":%s FJOIN %s %lu +%s", this->Instance->Config->GetSID().c_str(), c->name.c_str(), (unsigned long)c->age, c->ChanModes(true));
+                       dlen = curlen = snprintf(list, MAXBUF, ":%s FJOIN %s %lu +%s", this->ServerInstance->Config->GetSID().c_str(), c->name.c_str(), (unsigned long)c->age, c->ChanModes(true));
                        ptr = list + dlen;
                        numusers = 0;
                }
@@ -134,10 +134,10 @@ void TreeSocket::SendFJoins(TreeServer* Current, Channel* c)
                        params.append(" ").append(b->data);
                        linesize += size;
                }
-               if ((params.length() >= Instance->Config->Limits.MaxModes) || (currsize > 350))
+               if ((params.length() >= ServerInstance->Config->Limits.MaxModes) || (currsize > 350))
                {
                        /* Wrap at MAXMODES */
-                       buffer.append(":").append(this->Instance->Config->GetSID()).append(" FMODE ").append(c->name).append(" ").append(ConvToStr(c->age)).append(" +").append(modes).append(params).append("\r\n");
+                       buffer.append(":").append(this->ServerInstance->Config->GetSID()).append(" FMODE ").append(c->name).append(" ").append(ConvToStr(c->age)).append(" +").append(modes).append(params).append("\r\n");
                        modes.clear();
                        params.clear();
                        linesize = 1;
@@ -146,7 +146,7 @@ void TreeSocket::SendFJoins(TreeServer* Current, Channel* c)
 
        /* Only send these if there are any */
        if (!modes.empty())
-               buffer.append(":").append(this->Instance->Config->GetSID()).append(" FMODE ").append(c->name).append(" ").append(ConvToStr(c->age)).append(" +").append(modes).append(params);
+               buffer.append(":").append(this->ServerInstance->Config->GetSID()).append(" FMODE ").append(c->name).append(" ").append(ConvToStr(c->age)).append(" +").append(modes).append(params);
 
        this->WriteLine(buffer);
 }
@@ -155,14 +155,14 @@ void TreeSocket::SendFJoins(TreeServer* Current, Channel* c)
 void TreeSocket::SendXLines(TreeServer* Current)
 {
        char data[MAXBUF];
-       std::string n = this->Instance->Config->GetSID();
+       std::string n = this->ServerInstance->Config->GetSID();
        const char* sn = n.c_str();
 
-       std::vector<std::string> types = Instance->XLines->GetAllTypes();
+       std::vector<std::string> types = ServerInstance->XLines->GetAllTypes();
 
        for (std::vector<std::string>::iterator it = types.begin(); it != types.end(); ++it)
        {
-               XLineLookup* lookup = Instance->XLines->GetAll(*it);
+               XLineLookup* lookup = ServerInstance->XLines->GetAll(*it);
 
                if (lookup)
                {
@@ -190,9 +190,9 @@ void TreeSocket::SendChannelModes(TreeServer* Current)
 {
        char data[MAXBUF];
        std::deque<std::string> list;
-       std::string n = this->Instance->Config->GetSID();
+       std::string n = this->ServerInstance->Config->GetSID();
        const char* sn = n.c_str();
-       for (chan_hash::iterator c = this->Instance->chanlist->begin(); c != this->Instance->chanlist->end(); c++)
+       for (chan_hash::iterator c = this->ServerInstance->chanlist->begin(); c != this->ServerInstance->chanlist->end(); c++)
        {
                SendFJoins(Current, c->second);
                if (!c->second->topic.empty())
@@ -200,12 +200,12 @@ void TreeSocket::SendChannelModes(TreeServer* Current)
                        snprintf(data,MAXBUF,":%s FTOPIC %s %lu %s :%s", sn, c->second->name.c_str(), (unsigned long)c->second->topicset, c->second->setby.c_str(), c->second->topic.c_str());
                        this->WriteLine(data);
                }
-               FOREACH_MOD_I(this->Instance,I_OnSyncChannel,OnSyncChannel(c->second,(Module*)Utils->Creator,(void*)this));
+               FOREACH_MOD_I(this->ServerInstance,I_OnSyncChannel,OnSyncChannel(c->second,(Module*)Utils->Creator,(void*)this));
                list.clear();
                c->second->GetExtList(list);
                for (unsigned int j = 0; j < list.size(); j++)
                {
-                       FOREACH_MOD_I(this->Instance,I_OnSyncChannelMetaData,OnSyncChannelMetaData(c->second,(Module*)Utils->Creator,(void*)this,list[j]));
+                       FOREACH_MOD_I(this->ServerInstance,I_OnSyncChannelMetaData,OnSyncChannelMetaData(c->second,(Module*)Utils->Creator,(void*)this,list[j]));
                }
        }
 }
@@ -216,7 +216,7 @@ void TreeSocket::SendUsers(TreeServer* Current)
        char data[MAXBUF];
        std::deque<std::string> list;
        std::string dataline;
-       for (user_hash::iterator u = this->Instance->Users->clientlist->begin(); u != this->Instance->Users->clientlist->end(); u++)
+       for (user_hash::iterator u = this->ServerInstance->Users->clientlist->begin(); u != this->ServerInstance->Users->clientlist->end(); u++)
        {
                if (u->second->registered == REG_ALL)
                {
@@ -248,12 +248,12 @@ void TreeSocket::SendUsers(TreeServer* Current)
                                }
                        }
 
-                       FOREACH_MOD_I(this->Instance,I_OnSyncUser,OnSyncUser(u->second,(Module*)Utils->Creator,(void*)this));
+                       FOREACH_MOD_I(this->ServerInstance,I_OnSyncUser,OnSyncUser(u->second,(Module*)Utils->Creator,(void*)this));
                        list.clear();
                        u->second->GetExtList(list);
                        for (unsigned int j = 0; j < list.size(); j++)
                        {
-                               FOREACH_MOD_I(this->Instance,I_OnSyncUserMetaData,OnSyncUserMetaData(u->second,(Module*)Utils->Creator,(void*)this,list[j]));
+                               FOREACH_MOD_I(this->ServerInstance,I_OnSyncUserMetaData,OnSyncUserMetaData(u->second,(Module*)Utils->Creator,(void*)this,list[j]));
                        }
                }
        }
index 5531f9c0ee367b53948e72550fb15ce40be30b65..6df07b9cd1b2efc847cad6e970b3439209f1ab76 100644 (file)
@@ -105,7 +105,7 @@ int TreeSocket::DoCollision(User *u, time_t remotets, const std::string &remotei
                 * have 928AAAB's nick set to that.
                 *   -- w00t
                 */
-               User *remote = this->Instance->FindUUID(remoteuid);
+               User *remote = this->ServerInstance->FindUUID(remoteuid);
 
                if (remote)
                {
@@ -115,7 +115,7 @@ int TreeSocket::DoCollision(User *u, time_t remotets, const std::string &remotei
                else
                {
                        /* user has not been introduced yet, just inform their server */
-                       this->WriteLine(std::string(":")+this->Instance->Config->GetSID()+" SVSNICK "+remoteuid+" " + remoteuid + " " + ConvToStr(remotets));
+                       this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" SVSNICK "+remoteuid+" " + remoteuid + " " + ConvToStr(remotets));
                }
 
                if (!bChangeLocal)
index 77886c26ae355a18f77939efec1947e4ced521b3..f7390a6302c8e384ef630ae427522c380b47009e 100644 (file)
@@ -26,7 +26,7 @@ bool TreeSocket::OperQuit(const std::string &prefix, std::deque<std::string> &pa
        if (params.size() < 1)
                return true;
 
-       User* u = this->Instance->FindNick(prefix);
+       User* u = this->ServerInstance->FindNick(prefix);
 
        if (u)
        {
index c52cca60afa57bdffe534a5714b3353de5fbc1c0..77afbc0575415d3b9f28e2001de6422b81a080b7 100644 (file)
@@ -29,11 +29,11 @@ bool TreeSocket::OperType(const std::string &prefix, std::deque<std::string> &pa
        if (params.size() != 1)
                return true;
        std::string opertype = params[0];
-       User* u = this->Instance->FindNick(prefix);
+       User* u = this->ServerInstance->FindNick(prefix);
        if (u)
        {
                if (!u->IsModeSet('o'))
-                       this->Instance->Users->all_opers.push_back(u);
+                       this->ServerInstance->Users->all_opers.push_back(u);
                u->modes[UM_OPERATOR] = 1;
                u->oper.assign(opertype, 0, 512);
                Utils->DoOneToAllButSender(u->uuid, "OPERTYPE", params, u->server);
@@ -49,7 +49,7 @@ bool TreeSocket::OperType(const std::string &prefix, std::deque<std::string> &pa
                         */
                        if (
                                remoteserver->bursting ||
-                               this->Instance->SilentULine(this->Instance->FindServerNamePtr(u->server))
+                               this->ServerInstance->SilentULine(this->ServerInstance->FindServerNamePtr(u->server))
                           )
                        {
                                dosend = false;
@@ -57,7 +57,7 @@ bool TreeSocket::OperType(const std::string &prefix, std::deque<std::string> &pa
                }
 
                if (dosend)
-                       this->Instance->SNO->WriteToSnoMask('o',"From %s: User %s (%s@%s) is now an IRC operator of type %s",u->server, u->nick.c_str(),u->ident.c_str(), u->host.c_str(), irc::Spacify(opertype.c_str()));
+                       this->ServerInstance->SNO->WriteToSnoMask('o',"From %s: User %s (%s@%s) is now an IRC operator of type %s",u->server, u->nick.c_str(),u->ident.c_str(), u->host.c_str(), irc::Spacify(opertype.c_str()));
        }
        return true;
 }
index b884305b2330d09871b8b46d63cdba6ef1f80c54..3a2e9d37550146730f7dd9ea40cdc13d4eac0cc3 100644 (file)
@@ -33,13 +33,13 @@ bool TreeSocket::LocalPing(const std::string &prefix, std::deque<std::string> &p
        if (params.size() == 1)
        {
                std::string stufftobounce = params[0];
-               this->WriteLine(std::string(":")+this->Instance->Config->GetSID()+" PONG "+stufftobounce);
+               this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" PONG "+stufftobounce);
                return true;
        }
        else
        {
                std::string forwardto = params[1];
-               if (forwardto == this->Instance->Config->ServerName || forwardto == this->Instance->Config->GetSID())
+               if (forwardto == this->ServerInstance->Config->ServerName || forwardto == this->ServerInstance->Config->GetSID())
                {
                        // this is a ping for us, send back PONG to the requesting server
                        params[1] = params[0];
index 8e21f5a3eb5e2e28a2f5c35a7e73ffb3b0131b05..e14d62cb58dde38b2ba174495f021e49e72e557c 100644 (file)
@@ -46,7 +46,7 @@ bool TreeSocket::LocalPong(const std::string &prefix, std::deque<std::string> &p
        else
        {
                std::string forwardto = params[1];
-               if (forwardto == Instance->Config->GetSID() || forwardto == Instance->Config->ServerName)
+               if (forwardto == ServerInstance->Config->GetSID() || forwardto == ServerInstance->Config->ServerName)
                {
                        /*
                         * this is a PONG for us
@@ -54,7 +54,7 @@ bool TreeSocket::LocalPong(const std::string &prefix, std::deque<std::string> &p
                         * dump the PONG reply back to their fd. If its a server, do nowt.
                         * Services might want to send these s->s, but we dont need to yet.
                         */
-                       User* u = this->Instance->FindNick(prefix);
+                       User* u = this->ServerInstance->FindNick(prefix);
                        if (u)
                        {
                                u->WriteServ("PONG %s %s",params[0].c_str(),params[1].c_str());
index a685900480e34ff42792961f70f0de3d2473ae1f..da375630963da04c5f130718b9e4bf191012ed69 100644 (file)
@@ -32,49 +32,49 @@ bool TreeSocket::ServerMessage(const std::string &messagetype, const std::string
                const char* target = params[0].c_str();
                std::string text = params[1].c_str();
 
-               if (Instance->Modes->FindPrefix(*target))
+               if (ServerInstance->Modes->FindPrefix(*target))
                {
                        status = *target;
                        target++;
                }
 
-               Channel* channel = Instance->FindChan(target);
+               Channel* channel = ServerInstance->FindChan(target);
 
                if (channel)
                {
                        if (messagetype == "PRIVMSG")
                        {
-                               FOREACH_MOD_I(Instance, I_OnUserMessage, OnUserMessage(NULL, channel, TYPE_CHANNEL, text, status, except_list));
+                               FOREACH_MOD_I(ServerInstance, I_OnUserMessage, OnUserMessage(NULL, channel, TYPE_CHANNEL, text, status, except_list));
                        }
                        else
                        {
-                               FOREACH_MOD_I(Instance, I_OnUserNotice, OnUserNotice(NULL, channel, TYPE_CHANNEL, text, status, except_list));
+                               FOREACH_MOD_I(ServerInstance, I_OnUserNotice, OnUserNotice(NULL, channel, TYPE_CHANNEL, text, status, except_list));
                        }
                        TreeServer* s = Utils->FindServer(prefix);
                        if (s)
                        {
-                               FOREACH_MOD_I(Instance, I_OnText, OnText(NULL, channel, TYPE_CHANNEL, text, status, except_list));
+                               FOREACH_MOD_I(ServerInstance, I_OnText, OnText(NULL, channel, TYPE_CHANNEL, text, status, except_list));
                                channel->WriteChannelWithServ(s->GetName().c_str(), "%s %s :%s", messagetype.c_str(), channel->name.c_str(), text.c_str());
                        }
                }
                else
                {
-                       User* user = Instance->FindNick(target);
+                       User* user = ServerInstance->FindNick(target);
 
                        if (user)
                        {
                                if (messagetype == "PRIVMSG")
                                {
-                                       FOREACH_MOD_I(Instance, I_OnUserMessage, OnUserMessage(NULL, user, TYPE_USER, text, 0, except_list));
+                                       FOREACH_MOD_I(ServerInstance, I_OnUserMessage, OnUserMessage(NULL, user, TYPE_USER, text, 0, except_list));
                                }
                                else
                                {
-                                       FOREACH_MOD_I(Instance, I_OnUserNotice, OnUserNotice(NULL, user, TYPE_USER, text, 0, except_list));
+                                       FOREACH_MOD_I(ServerInstance, I_OnUserNotice, OnUserNotice(NULL, user, TYPE_USER, text, 0, except_list));
                                }
                                TreeServer* s = Utils->FindServer(prefix);
                                if (s)
                                {
-                                       FOREACH_MOD_I(Instance, I_OnText, OnText(NULL, user, TYPE_USER, text, status, except_list));
+                                       FOREACH_MOD_I(ServerInstance, I_OnText, OnText(NULL, user, TYPE_USER, text, status, except_list));
                                        user->Write(":%s %s %s :%s", s->GetName().c_str(), messagetype.c_str(), user->nick.c_str(), text.c_str());
                                }
 
index b2fc045f0f6052a3b08801bef199abfe79762a33..e17c83499268c72a4293a140b55680b836e9b121 100644 (file)
@@ -30,7 +30,7 @@ bool TreeSocket::Push(const std::string &prefix, std::deque<std::string> &params
 {
        if (params.size() < 2)
                return true;
-       User* u = this->Instance->FindNick(params[0]);
+       User* u = this->ServerInstance->FindNick(params[0]);
        if (!u)
                return true;
        if (IS_LOCAL(u))
index 0ff0e30f62f3485a8478616045465a77dc6c87df..1254d14d416dba6407254cd18d58f95d67045bb3 100644 (file)
@@ -51,7 +51,7 @@ bool TreeSocket::RemoteServer(const std::string &prefix, std::deque<std::string>
                this->SendError("Protocol error - Introduced remote server from unknown server "+ParentOfThis->GetName());
                return false;
        }
-       if (!this->Instance->IsSID(sid))
+       if (!this->ServerInstance->IsSID(sid))
        {
                this->SendError("Invalid format server ID: "+sid+"!");
                return false;
@@ -60,25 +60,25 @@ bool TreeSocket::RemoteServer(const std::string &prefix, std::deque<std::string>
        if (CheckDupe)
        {
                this->SendError("Server "+CheckDupe->GetName()+" already exists!");
-               this->Instance->SNO->WriteToSnoMask('l',"Server \2"+CheckDupe->GetName()+"\2 being introduced from \2" + ParentOfThis->GetName() + "\2 denied, already exists. Closing link with " + ParentOfThis->GetName());
+               this->ServerInstance->SNO->WriteToSnoMask('l',"Server \2"+CheckDupe->GetName()+"\2 being introduced from \2" + ParentOfThis->GetName() + "\2 denied, already exists. Closing link with " + ParentOfThis->GetName());
                return false;
        }
 
        Link* lnk = Utils->FindLink(servername);
 
-       TreeServer *Node = new TreeServer(this->Utils, this->Instance, servername, description, sid, ParentOfThis,NULL, lnk ? lnk->Hidden : false);
+       TreeServer *Node = new TreeServer(this->Utils, this->ServerInstance, servername, description, sid, ParentOfThis,NULL, lnk ? lnk->Hidden : false);
 
        if (Node->DuplicateID())
        {
                this->SendError("Server ID "+servername+" already exists on the network!");
-               this->Instance->SNO->WriteToSnoMask('l',"Server \2"+servername+"\2 being introduced from \2" + ParentOfThis->GetName() + "\2 denied, server ID already exists on the network. Closing link with " + ParentOfThis->GetName());
+               this->ServerInstance->SNO->WriteToSnoMask('l',"Server \2"+servername+"\2 being introduced from \2" + ParentOfThis->GetName() + "\2 denied, server ID already exists on the network. Closing link with " + ParentOfThis->GetName());
                return false;
        }
 
        ParentOfThis->AddChild(Node);
        params[4] = ":" + params[4];
        Utils->DoOneToAllButSender(prefix,"SERVER",params,prefix);
-       this->Instance->SNO->WriteToSnoMask('l',"Server \002"+ParentOfThis->GetName()+"\002 introduced server \002"+servername+"\002 ("+description+")");
+       this->ServerInstance->SNO->WriteToSnoMask('l',"Server \002"+ParentOfThis->GetName()+"\002 introduced server \002"+servername+"\002 ("+description+")");
        return true;
 }
 
@@ -112,11 +112,11 @@ bool TreeSocket::Outbound_Reply_Server(std::deque<std::string> &params)
        if (hops)
        {
                this->SendError("Server too far away for authentication");
-               this->Instance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, server is too far away for authentication");
+               this->ServerInstance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, server is too far away for authentication");
                return false;
        }
 
-       if (!this->Instance->IsSID(sid))
+       if (!this->ServerInstance->IsSID(sid))
        {
                this->SendError("Invalid format server ID: "+sid+"!");
                return false;
@@ -130,7 +130,7 @@ bool TreeSocket::Outbound_Reply_Server(std::deque<std::string> &params)
                if (!ComparePass(this->MakePass(x->RecvPass, this->GetOurChallenge()), password) &&
                        (x->RecvPass != password && this->GetTheirChallenge().empty()))
                {
-                       this->Instance->SNO->WriteToSnoMask('l',"Invalid password on link: %s", x->Name.c_str());
+                       this->ServerInstance->SNO->WriteToSnoMask('l',"Invalid password on link: %s", x->Name.c_str());
                        continue;
                }
 
@@ -138,7 +138,7 @@ bool TreeSocket::Outbound_Reply_Server(std::deque<std::string> &params)
                if (CheckDupe)
                {
                        this->SendError("Server "+sname+" already exists on server "+CheckDupe->GetParent()->GetName()+"!");
-                       this->Instance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, already exists on server "+CheckDupe->GetParent()->GetName());
+                       this->ServerInstance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, already exists on server "+CheckDupe->GetParent()->GetName());
                        return false;
                }
 
@@ -152,12 +152,12 @@ bool TreeSocket::Outbound_Reply_Server(std::deque<std::string> &params)
                 */
                this->LinkState = CONNECTED;
 
-               TreeServer *Node = new TreeServer(this->Utils, this->Instance, sname, description, sid, Utils->TreeRoot, this, x->Hidden);
+               TreeServer *Node = new TreeServer(this->Utils, this->ServerInstance, sname, description, sid, Utils->TreeRoot, this, x->Hidden);
 
                if (Node->DuplicateID())
                {
                        this->SendError("Server ID "+sid+" already exists on the network!");
-                       this->Instance->SNO->WriteToSnoMask('l',"Server \2"+assign(servername)+"\2 being introduced denied, server ID already exists on the network. Closing link.");
+                       this->ServerInstance->SNO->WriteToSnoMask('l',"Server \2"+assign(servername)+"\2 being introduced denied, server ID already exists on the network. Closing link.");
                        return false;
                }
 
@@ -167,7 +167,7 @@ bool TreeSocket::Outbound_Reply_Server(std::deque<std::string> &params)
 
                /* IMPORTANT: Take password/hmac hash OUT of here before we broadcast the introduction! */
                params[1] = "*";
-               Utils->DoOneToAllButSender(Instance->Config->GetSID(),"SERVER",params,sname);
+               Utils->DoOneToAllButSender(ServerInstance->Config->GetSID(),"SERVER",params,sname);
 
                Node->bursting = true;
                this->DoBurst(Node);
@@ -175,7 +175,7 @@ bool TreeSocket::Outbound_Reply_Server(std::deque<std::string> &params)
        }
 
        this->SendError("Invalid credentials (check the other server's linking snomask for more information)");
-       this->Instance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, invalid link credentials");
+       this->ServerInstance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, invalid link credentials");
        return false;
 }
 
@@ -208,11 +208,11 @@ bool TreeSocket::Inbound_Server(std::deque<std::string> &params)
        if (hops)
        {
                this->SendError("Server too far away for authentication");
-               this->Instance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, server is too far away for authentication");
+               this->ServerInstance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, server is too far away for authentication");
                return false;
        }
 
-       if (!this->Instance->IsSID(sid))
+       if (!this->ServerInstance->IsSID(sid))
        {
                this->SendError("Invalid format server ID: "+sid+"!");
                return false;
@@ -226,49 +226,49 @@ bool TreeSocket::Inbound_Server(std::deque<std::string> &params)
                if (!ComparePass(this->MakePass(x->RecvPass, this->GetOurChallenge()), password) &&
                        (x->RecvPass != password && this->GetTheirChallenge().empty()))
                {
-                       this->Instance->SNO->WriteToSnoMask('l',"Invalid password on link: %s", x->Name.c_str());
+                       this->ServerInstance->SNO->WriteToSnoMask('l',"Invalid password on link: %s", x->Name.c_str());
                        continue;
                }
 
                /* Check for fully initialized instances of the server by id */
-               Instance->Logs->Log("m_spanningtree",DEBUG,"Looking for dupe SID %s", sid.c_str());
+               ServerInstance->Logs->Log("m_spanningtree",DEBUG,"Looking for dupe SID %s", sid.c_str());
                TreeServer* CheckDupeSID = Utils->FindServerID(sid);
 
                if (CheckDupeSID)
                {
                        this->SendError("Server ID "+CheckDupeSID->GetID()+" already exists on server "+CheckDupeSID->GetName()+"!");
-                       this->Instance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, server ID '"+CheckDupeSID->GetID()+
+                       this->ServerInstance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, server ID '"+CheckDupeSID->GetID()+
                                        "' already exists on server "+CheckDupeSID->GetName());
                        return false;
                }
 
-               /* Now check for fully initialized instances of the server by name */
+               /* Now check for fully initialized ServerInstances of the server by name */
                TreeServer* CheckDupe = Utils->FindServer(sname);
                if (CheckDupe)
                {
                        this->SendError("Server "+sname+" already exists on server "+CheckDupe->GetParent()->GetName()+"!");
-                       this->Instance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, already exists on server "+CheckDupe->GetParent()->GetName());
+                       this->ServerInstance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, already exists on server "+CheckDupe->GetParent()->GetName());
                        return false;
                }
 
-               this->Instance->SNO->WriteToSnoMask('l',"Verified incoming server connection from \002"+sname+"\002["+(x->HiddenFromStats ? "<hidden>" : this->GetIP())+"] ("+description+")");
+               this->ServerInstance->SNO->WriteToSnoMask('l',"Verified incoming server connection from \002"+sname+"\002["+(x->HiddenFromStats ? "<hidden>" : this->GetIP())+"] ("+description+")");
                if (this->Hook)
                {
                        std::string name = BufferedSocketNameRequest((Module*)Utils->Creator, this->Hook).Send();
-                       this->Instance->SNO->WriteToSnoMask('l',"Connection from \2"+sname+"\2["+(x->HiddenFromStats ? "<hidden>" : this->GetIP())+"] using transport \2"+name+"\2");
+                       this->ServerInstance->SNO->WriteToSnoMask('l',"Connection from \2"+sname+"\2["+(x->HiddenFromStats ? "<hidden>" : this->GetIP())+"] using transport \2"+name+"\2");
                }
 
                // this is good. Send our details: Our server name and description and hopcount of 0,
                // along with the sendpass from this block.
                this->SendCapabilities();
-               this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+this->MakePass(x->SendPass, this->GetTheirChallenge())+" 0 "+Instance->Config->GetSID()+" :"+this->Instance->Config->ServerDesc);
+               this->WriteLine(std::string("SERVER ")+this->ServerInstance->Config->ServerName+" "+this->MakePass(x->SendPass, this->GetTheirChallenge())+" 0 "+ServerInstance->Config->GetSID()+" :"+this->ServerInstance->Config->ServerDesc);
                // move to the next state, we are now waiting for THEM.
                this->LinkState = WAIT_AUTH_2;
                return true;
        }
 
        this->SendError("Invalid credentials");
-       this->Instance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, invalid link credentials");
+       this->ServerInstance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, invalid link credentials");
        return false;
 }
 
index 8d74a8bbfa7a53da15ebd10169e4bbb8a07e7245..759255a6bb3baef737d625819610ae72946d9a4b 100644 (file)
@@ -34,28 +34,28 @@ bool TreeSocket::Stats(const std::string &prefix, std::deque<std::string> &param
         */
        if (params.size() > 1)
        {
-               if (InspIRCd::Match(this->Instance->Config->ServerName, params[1]))
+               if (InspIRCd::Match(this->ServerInstance->Config->ServerName, params[1]))
                {
                        /* It's for our server */
                        string_list results;
-                       User* source = this->Instance->FindNick(prefix);
+                       User* source = this->ServerInstance->FindNick(prefix);
                        if (source)
                        {
                                std::deque<std::string> par;
                                par.push_back(prefix);
                                par.push_back("");
-                               DoStats(this->Instance, *(params[0].c_str()), source, results);
+                               DoStats(this->ServerInstance, *(params[0].c_str()), source, results);
                                for (size_t i = 0; i < results.size(); i++)
                                {
                                        par[1] = "::" + results[i];
-                                       Utils->DoOneToOne(this->Instance->Config->GetSID(), "PUSH",par, source->server);
+                                       Utils->DoOneToOne(this->ServerInstance->Config->GetSID(), "PUSH",par, source->server);
                                }
                        }
                }
                else
                {
                        /* Pass it on */
-                       User* source = this->Instance->FindNick(prefix);
+                       User* source = this->ServerInstance->FindNick(prefix);
                        if (source)
                                Utils->DoOneToOne(source->uuid, "STATS", params, params[1]);
                }
index d3c47f47bec8780d94e0f3fc0818ffa9f11f8e3a..92fe0ac22d866afc68d2f7096884df96b5b6c805 100644 (file)
@@ -31,13 +31,13 @@ bool TreeSocket::ServiceJoin(const std::string &prefix, std::deque<std::string>
        if (params.size() < 2)
                return true;
 
-       User* u = this->Instance->FindNick(params[0]);
+       User* u = this->ServerInstance->FindNick(params[0]);
 
        if (u)
        {
                /* only join if it's local, otherwise just pass it on! */
                if (IS_LOCAL(u))
-                       Channel::JoinUser(this->Instance, u, params[1].c_str(), false, "", false, Instance->Time());
+                       Channel::JoinUser(this->ServerInstance, u, params[1].c_str(), false, "", false, ServerInstance->Time());
                Utils->DoOneToAllButSender(prefix,"SVSJOIN",params,prefix);
        }
        return true;
index ef57f6dbb6440b6220069df4dda0e6ff847afc9e..95b49e0c7ca2300a9358d05d859a13efbb785bd7 100644 (file)
@@ -34,7 +34,7 @@ bool TreeSocket::ForceNick(const std::string &prefix, std::deque<std::string> &p
        if (params.size() < 3)
                return true;
 
-       User* u = this->Instance->FindNick(params[0]);
+       User* u = this->ServerInstance->FindNick(params[0]);
 
        if (u)
        {
@@ -50,7 +50,7 @@ bool TreeSocket::ForceNick(const std::string &prefix, std::deque<std::string> &p
                                /* buh. UID them */
                                if (!u->ForceNickChange(u->uuid.c_str()))
                                {
-                                       this->Instance->Users->QuitUser(u, "Nickname collision");
+                                       this->ServerInstance->Users->QuitUser(u, "Nickname collision");
                                        return true;
                                }
                        }
index 95d1a1c2337a86eb226afbca6837c016a3fd608b..59f9b7fcc2a9934dd0809d125fd37d99fa63866d 100644 (file)
@@ -36,8 +36,8 @@ bool TreeSocket::ServicePart(const std::string &prefix, std::deque<std::string>
        if (params.size() == 3)
                reason = params[2];
 
-       User* u = this->Instance->FindNick(params[0]);
-       Channel* c = this->Instance->FindChan(params[1]);
+       User* u = this->ServerInstance->FindNick(params[0]);
+       Channel* c = this->ServerInstance->FindChan(params[1]);
 
        if (u)
        {
index eb90eab8d50290ba96420cac355076c0f6049259..da05b5ded5d9e166cadcec77ad4dd809bf567b1b 100644 (file)
@@ -33,20 +33,20 @@ bool TreeSocket::Time(const std::string &prefix, std::deque<std::string> &params
        if (params.size() == 2)
        {
                // someone querying our time?
-               if (this->Instance->Config->ServerName == params[0] || this->Instance->Config->GetSID() == params[0])
+               if (this->ServerInstance->Config->ServerName == params[0] || this->ServerInstance->Config->GetSID() == params[0])
                {
-                       User* u = this->Instance->FindNick(params[1]);
+                       User* u = this->ServerInstance->FindNick(params[1]);
                        if (u)
                        {
-                               params.push_back(ConvToStr(Instance->Time()));
+                               params.push_back(ConvToStr(ServerInstance->Time()));
                                params[0] = prefix;
-                               Utils->DoOneToOne(this->Instance->Config->GetSID(),"TIME",params,params[0]);
+                               Utils->DoOneToOne(this->ServerInstance->Config->GetSID(),"TIME",params,params[0]);
                        }
                }
                else
                {
                        // not us, pass it on
-                       User* u = this->Instance->FindNick(params[1]);
+                       User* u = this->ServerInstance->FindNick(params[1]);
                        if (u)
                                Utils->DoOneToOne(prefix,"TIME",params,params[0]);
                }
@@ -54,7 +54,7 @@ bool TreeSocket::Time(const std::string &prefix, std::deque<std::string> &params
        else if (params.size() == 3)
        {
                // a response to a previous TIME
-               User* u = this->Instance->FindNick(params[1]);
+               User* u = this->ServerInstance->FindNick(params[1]);
                if ((u) && (IS_LOCAL(u)))
                {
                        time_t rawtime = atol(params[2].c_str());
index a89bd25744bf48d557fda06530c1c8faf23ec569..03fd05a3419e8f6db3ffdece250e1d87ce212108 100644 (file)
@@ -65,7 +65,7 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, int newfd, cha
        if (Hook)
                BufferedSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send();
 
-       Instance->Timers->AddTimer(new HandshakeTimer(Instance, this, &(Utils->LinkBlocks[0]), this->Utils, 1));
+       ServerInstance->Timers->AddTimer(new HandshakeTimer(ServerInstance, this, &(Utils->LinkBlocks[0]), this->Utils, 1));
 
        /* Fix by Brain - inbound sockets need a timeout, too. 30 secs should be pleanty */
        Utils->timeoutlist[this] = std::pair<std::string, int>("<unknown>", 30);
@@ -115,7 +115,7 @@ bool TreeSocket::OnConnected()
 
                                /* found who we're supposed to be connecting to, send the neccessary gubbins. */
                                if (this->GetHook())
-                                       Instance->Timers->AddTimer(new HandshakeTimer(Instance, this, &(*x), this->Utils, 1));
+                                       ServerInstance->Timers->AddTimer(new HandshakeTimer(ServerInstance, this, &(*x), this->Utils, 1));
                                else
                                        this->SendCapabilities();
 
@@ -211,7 +211,7 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason)
        if ((Current) && (Current != Utils->TreeRoot))
        {
                Event rmode((char*)Current->GetName().c_str(), (Module*)Utils->Creator, "lost_server");
-               rmode.Send(Instance);
+               rmode.Send(ServerInstance);
 
                std::deque<std::string> params;
                params.push_back(Current->GetName());
@@ -219,11 +219,11 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason)
                Utils->DoOneToAllButSender(Current->GetParent()->GetName(),"SQUIT",params,Current->GetName());
                if (Current->GetParent() == Utils->TreeRoot)
                {
-                       this->Instance->SNO->WriteToSnoMask('l',"Server \002"+Current->GetName()+"\002 split: "+reason);
+                       this->ServerInstance->SNO->WriteToSnoMask('l',"Server \002"+Current->GetName()+"\002 split: "+reason);
                }
                else
                {
-                       this->Instance->SNO->WriteToSnoMask('l',"Server \002"+Current->GetName()+"\002 split from server \002"+Current->GetParent()->GetName()+"\002 with reason: "+reason);
+                       this->ServerInstance->SNO->WriteToSnoMask('l',"Server \002"+Current->GetName()+"\002 split from server \002"+Current->GetParent()->GetName()+"\002 with reason: "+reason);
                }
                num_lost_servers = 0;
                num_lost_users = 0;
@@ -232,10 +232,10 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason)
                Current->Tidy();
                Current->GetParent()->DelChild(Current);
                delete Current;
-               this->Instance->SNO->WriteToSnoMask('l',"Netsplit complete, lost \002%d\002 users on \002%d\002 servers.", num_lost_users, num_lost_servers);
+               this->ServerInstance->SNO->WriteToSnoMask('l',"Netsplit complete, lost \002%d\002 users on \002%d\002 servers.", num_lost_users, num_lost_servers);
        }
        else
-               Instance->Logs->Log("m_spanningtree",DEFAULT,"Squit from unknown server");
+               ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Squit from unknown server");
 }
 
 /** This function is called when we receive data from a remote
index c1b45237df2dfc0c85de78e6504472a54547bbee..8b3fbf2fb68b786ed493742fbf325674560d50c0 100644 (file)
@@ -31,7 +31,7 @@
 
 void TreeSocket::WriteLine(std::string line)
 {
-       Instance->Logs->Log("m_spanningtree",DEBUG, "S[%d] O %s", this->GetFd(), line.c_str());
+       ServerInstance->Logs->Log("m_spanningtree",DEBUG, "S[%d] O %s", this->GetFd(), line.c_str());
        line.append("\r\n");
        this->Write(line);
 }
@@ -42,7 +42,7 @@ bool TreeSocket::Error(std::deque<std::string> &params)
 {
        if (params.size() < 1)
                return false;
-       this->Instance->SNO->WriteToSnoMask('l',"ERROR from %s: %s",(!InboundServerName.empty() ? InboundServerName.c_str() : myhost.c_str()),params[0].c_str());
+       this->ServerInstance->SNO->WriteToSnoMask('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;
 }
@@ -70,7 +70,7 @@ bool TreeSocket::ProcessLine(std::string &line)
        if (line.empty())
                return true;
 
-       Instance->Logs->Log("m_spanningtree",DEBUG, "S[%d] I %s", this->GetFd(), line.c_str());
+       ServerInstance->Logs->Log("m_spanningtree",DEBUG, "S[%d] I %s", this->GetFd(), line.c_str());
 
        this->Split(line.c_str(),params);
 
@@ -160,16 +160,16 @@ bool TreeSocket::ProcessLine(std::string &line)
                                if (params.size())
                                {
                                        time_t them = atoi(params[0].c_str());
-                                       time_t delta = them - Instance->Time();
+                                       time_t delta = them - ServerInstance->Time();
                                        if ((delta < -600) || (delta > 600))
                                        {
-                                               Instance->SNO->WriteToSnoMask('l',"\2ERROR\2: Your clocks are out by %d seconds (this is more than five minutes). Link aborted, \2PLEASE SYNC YOUR CLOCKS!\2",abs((long)delta));
+                                               ServerInstance->SNO->WriteToSnoMask('l',"\2ERROR\2: Your clocks are out by %d seconds (this is more than five minutes). Link aborted, \2PLEASE SYNC YOUR CLOCKS!\2",abs((long)delta));
                                                SendError("Your clocks are out by "+ConvToStr(abs((long)delta))+" seconds (this is more than five minutes). Link aborted, PLEASE SYNC YOUR CLOCKS!");
                                                return false;
                                        }
                                        else if ((delta < -30) || (delta > 30))
                                        {
-                                               Instance->SNO->WriteToSnoMask('l',"\2WARNING\2: Your clocks are out by %d seconds. Please consider synching your clocks.", abs((long)delta));
+                                               ServerInstance->SNO->WriteToSnoMask('l',"\2WARNING\2: Your clocks are out by %d seconds. Please consider synching your clocks.", abs((long)delta));
                                        }
                                }
                                this->LinkState = CONNECTED;
@@ -177,12 +177,12 @@ bool TreeSocket::ProcessLine(std::string &line)
 
                                Utils->timeoutlist.erase(this);
 
-                               Node = new TreeServer(this->Utils, this->Instance, InboundServerName, InboundDescription, InboundSID, Utils->TreeRoot, this, lnk ? lnk->Hidden : false);
+                               Node = new TreeServer(this->Utils, this->ServerInstance, InboundServerName, InboundDescription, InboundSID, Utils->TreeRoot, this, lnk ? lnk->Hidden : false);
 
                                if (Node->DuplicateID())
                                {
                                        this->SendError("Server ID "+InboundSID+" already exists on the network!");
-                                       this->Instance->SNO->WriteToSnoMask('l',"Server \2"+InboundServerName+"\2 being introduced from \2" + prefix + "\2 denied, server ID already exists on the network. Closing link.");
+                                       this->ServerInstance->SNO->WriteToSnoMask('l',"Server \2"+InboundServerName+"\2 being introduced from \2" + prefix + "\2 denied, server ID already exists on the network. Closing link.");
                                        return false;
                                }
 
@@ -193,7 +193,7 @@ bool TreeSocket::ProcessLine(std::string &line)
                                params.push_back("1");
                                params.push_back(InboundSID);
                                params.push_back(":"+InboundDescription);
-                               Utils->DoOneToAllButSender(Instance->Config->GetSID(),"SERVER",params,InboundServerName);
+                               Utils->DoOneToAllButSender(ServerInstance->Config->GetSID(),"SERVER",params,InboundServerName);
                                Node->bursting = true;
                                this->DoBurst(Node);
                        }
@@ -250,7 +250,7 @@ bool TreeSocket::ProcessLine(std::string &line)
                                 */
                                std::string direction = prefix;
 
-                               User *t = this->Instance->FindUUID(prefix);
+                               User *t = this->ServerInstance->FindUUID(prefix);
                                if (t)
                                {
                                        direction = t->server;
@@ -260,14 +260,14 @@ bool TreeSocket::ProcessLine(std::string &line)
                                if ((!route_back_again) || (route_back_again->GetSocket() != this))
                                {
                                        if (route_back_again)
-                                               Instance->Logs->Log("m_spanningtree",DEBUG,"Protocol violation: Fake direction in command '%s' from connection '%s'",line.c_str(),this->GetName().c_str());
+                                               ServerInstance->Logs->Log("m_spanningtree",DEBUG,"Protocol violation: Fake direction in command '%s' from connection '%s'",line.c_str(),this->GetName().c_str());
                                        return true;
                                }
                                /* Fix by brain:
                                 * When there is activity on the socket, reset the ping counter so
                                 * that we're not wasting bandwidth pinging an active server.
                                 */
-                               route_back_again->SetNextPingTime(Instance->Time() + Utils->PingFreq);
+                               route_back_again->SetNextPingTime(ServerInstance->Time() + Utils->PingFreq);
                                route_back_again->SetPingFlag();
                        }
                        else
@@ -343,7 +343,7 @@ bool TreeSocket::ProcessLine(std::string &line)
                        }
                        else if (command == "MAP")
                        {
-                               User* user = Instance->FindNick(prefix);
+                               User* user = ServerInstance->FindNick(prefix);
                                if (user)
                                {
                                        std::vector<std::string> p(params.begin(), params.end());
@@ -383,7 +383,7 @@ bool TreeSocket::ProcessLine(std::string &line)
                                TreeServer *s = Utils->FindServer(prefix);
                                if (s && s->bursting)
                                {
-                                       Instance->SNO->WriteToSnoMask('l',"Server \002%s\002 has not finished burst, forcing end of burst (send ENDBURST!)", prefix.c_str());
+                                       ServerInstance->SNO->WriteToSnoMask('l',"Server \002%s\002 has not finished burst, forcing end of burst (send ENDBURST!)", prefix.c_str());
                                        s->FinishBurst();
                                }
                                return this->LocalPong(prefix,params);
@@ -433,8 +433,8 @@ bool TreeSocket::ProcessLine(std::string &line)
                                if (params.size() == 3)
                                {
                                        TreeServer* pf = Utils->FindServer(prefix);
-                                       User* user = this->Instance->FindNick(params[1]);
-                                       Channel* chan = this->Instance->FindChan(params[0]);
+                                       User* user = this->ServerInstance->FindNick(params[1]);
+                                       Channel* chan = this->ServerInstance->FindChan(params[0]);
                                        if (pf && user && chan)
                                        {
                                                if (!chan->ServerKickUser(user, params[2].c_str(), false, pf->GetName().c_str()))
@@ -466,7 +466,7 @@ bool TreeSocket::ProcessLine(std::string &line)
                                if (params.size() >= 2)
                                {
                                        if (ServerSource)
-                                               Instance->Users->WriteMode(params[0].c_str(), WM_AND, "*** From %s: %s", (ServerSource ? ServerSource->GetName().c_str() : prefix.c_str()), params[1].c_str());
+                                               ServerInstance->Users->WriteMode(params[0].c_str(), WM_AND, "*** From %s: %s", (ServerSource ? ServerSource->GetName().c_str() : prefix.c_str()), params[1].c_str());
                                }
                                return Utils->DoOneToAllButSenderRaw(line, sourceserv, prefix, command, params);
                        }
@@ -474,7 +474,7 @@ bool TreeSocket::ProcessLine(std::string &line)
                        {
                                if (params.size() >= 2)
                                {
-                                       Instance->SNO->WriteToSnoMask(*(params[0].c_str()), "From " + (ServerSource ? ServerSource->GetName().c_str() : prefix) + ": "+ params[1]);
+                                       ServerInstance->SNO->WriteToSnoMask(*(params[0].c_str()), "From " + (ServerSource ? ServerSource->GetName().c_str() : prefix) + ": "+ params[1]);
                                        return Utils->DoOneToAllButSenderRaw(line, sourceserv, prefix, command, params);
                                }
 
@@ -484,7 +484,7 @@ bool TreeSocket::ProcessLine(std::string &line)
                                // Set prefix server as bursting
                                if (!ServerSource)
                                {
-                                       this->Instance->SNO->WriteToSnoMask('l', "WTF: Got BURST from a nonexistant server(?): %s", (ServerSource ? ServerSource->GetName().c_str() : prefix.c_str()));
+                                       this->ServerInstance->SNO->WriteToSnoMask('l', "WTF: Got BURST from a nonexistant server(?): %s", (ServerSource ? ServerSource->GetName().c_str() : prefix.c_str()));
                                        return false;
                                }
 
@@ -495,7 +495,7 @@ bool TreeSocket::ProcessLine(std::string &line)
                        {
                                if (!ServerSource)
                                {
-                                       this->Instance->SNO->WriteToSnoMask('l', "WTF: Got ENDBURST from a nonexistant server(?): %s", (ServerSource ? ServerSource->GetName().c_str() : prefix.c_str()));
+                                       this->ServerInstance->SNO->WriteToSnoMask('l', "WTF: Got ENDBURST from a nonexistant server(?): %s", (ServerSource ? ServerSource->GetName().c_str() : prefix.c_str()));
                                        return false;
                                }
 
@@ -506,7 +506,7 @@ bool TreeSocket::ProcessLine(std::string &line)
                        {
                                return this->Encap(prefix, params);
                        }
-                       else if (command == "MODE" && !this->Instance->FindUUID(prefix)) // XXX we should check for no such serv?
+                       else if (command == "MODE" && !this->ServerInstance->FindUUID(prefix)) // XXX we should check for no such serv?
                        {
                                // Server-prefix MODE.
                                std::vector<std::string> modelist(params.begin(), params.end());
@@ -514,7 +514,7 @@ bool TreeSocket::ProcessLine(std::string &line)
                                /* We don't support this for channel mode changes any more! */
                                if (params.size() >= 1)
                                {
-                                       if (Instance->FindChan(params[0]))
+                                       if (ServerInstance->FindChan(params[0]))
                                        {
                                                this->SendError("Protocol violation by '"+(ServerSource ? ServerSource->GetName().c_str() : prefix)+"'! MODE for channel mode changes is not supported by the InspIRCd 1.2 protocol. You must use FMODE to preserve channel timestamps.");
                                                return false;
@@ -522,7 +522,7 @@ bool TreeSocket::ProcessLine(std::string &line)
                                }
 
                                // Insert into the parser
-                               this->Instance->SendMode(modelist, this->Instance->FakeClient);
+                               this->ServerInstance->SendMode(modelist, this->ServerInstance->FakeClient);
 
                                // Pass out to the network
                                return Utils->DoOneToAllButSenderRaw(line,sourceserv,prefix,command,params);
@@ -533,7 +533,7 @@ bool TreeSocket::ProcessLine(std::string &line)
                                 * Not a special s2s command. Emulate the user doing it.
                                 * This saves us having a huge ugly command parser again.
                                 */
-                               User *who = this->Instance->FindUUID(prefix);
+                               User *who = this->ServerInstance->FindUUID(prefix);
 
                                if (!who)
                                {
@@ -556,7 +556,7 @@ bool TreeSocket::ProcessLine(std::string &line)
                                         * On nick messages, check that the nick doesnt already exist here.
                                         * If it does, perform collision logic.
                                         */
-                                       User* x = this->Instance->FindNickOnly(params[0]);
+                                       User* x = this->ServerInstance->FindNickOnly(params[0]);
                                        if ((x) && (x != who))
                                        {
                                                int collideret = 0;
@@ -577,7 +577,7 @@ bool TreeSocket::ProcessLine(std::string &line)
                                // its a user
                                std::vector<std::string> strparams(params.begin(), params.end());
 
-                               switch (this->Instance->CallCommandHandler(command.c_str(), strparams, who))
+                               switch (this->ServerInstance->CallCommandHandler(command.c_str(), strparams, who))
                                {
                                        case CMD_INVALID:
                                                /*
@@ -650,7 +650,7 @@ void TreeSocket::OnClose()
        if (!quitserver.empty())
        {
                Utils->Creator->RemoteMessage(NULL,"Connection to '\2%s\2' failed.",quitserver.c_str());
-               time_t server_uptime = Instance->Time() - this->age;
+               time_t server_uptime = ServerInstance->Time() - this->age;
                if (server_uptime)
                        Utils->Creator->RemoteMessage(NULL,"Connection to '\2%s\2' was established for %s", quitserver.c_str(), Utils->Creator->TimeToStr(server_uptime).c_str());
        }
index 14c4e2bb59077c4037d637360b73d0c1b7ef248b..7b7a477f28bfd454ae58981763bdc8c6531a2054 100644 (file)
@@ -39,7 +39,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
        if (params.size() < 10)
        {
                if (!params.empty())
-                       this->WriteLine(std::string(":")+this->Instance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction ("+params[0]+" with only "+
+                       this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction ("+params[0]+" with only "+
                                        ConvToStr(params.size())+" of 10 or more parameters?)");
                return true;
        }
@@ -52,26 +52,26 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
 
        if (!remoteserver)
        {
-               this->WriteLine(std::string(":")+this->Instance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction (Unknown server "+source+")");
+               this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction (Unknown server "+source+")");
                return true;
        }
 
        /* Check parameters for validity before introducing the client, discovered by dmb */
        if (!age_t)
        {
-               this->WriteLine(std::string(":")+this->Instance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction (Invalid TS?)");
+               this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction (Invalid TS?)");
                return true;
        }
 
        /* check for collision */
-       user_hash::iterator iter = this->Instance->Users->clientlist->find(params[2]);
+       user_hash::iterator iter = this->ServerInstance->Users->clientlist->find(params[2]);
 
-       if (iter != this->Instance->Users->clientlist->end())
+       if (iter != this->ServerInstance->Users->clientlist->end())
        {
                /*
                 * Nick collision.
                 */
-               Instance->Logs->Log("m_spanningtree",DEBUG,"*** Collision on %s", params[2].c_str());
+               ServerInstance->Logs->Log("m_spanningtree",DEBUG,"*** Collision on %s", params[2].c_str());
                int collide = this->DoCollision(iter->second, age_t, params[5], params[8], params[0]);
 
                if (collide == 2)
@@ -87,19 +87,19 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
        User* _new = NULL;
        try
        {
-               _new = new User(this->Instance, params[0]);
+               _new = new User(this->ServerInstance, params[0]);
        }
        catch (...)
        {
                SendError("Protocol violation - Duplicate UUID '" + params[0] + "' on introduction of new user");
                return false;
        }
-       (*(this->Instance->Users->clientlist))[params[2]] = _new;
+       (*(this->ServerInstance->Users->clientlist))[params[2]] = _new;
        _new->SetFd(FD_MAGIC_NUMBER);
        _new->nick.assign(params[2], 0, MAXBUF);
        _new->host.assign(params[3], 0, 64);
        _new->dhost.assign(params[4], 0, 64);
-       _new->server = this->Instance->FindServerNamePtr(remoteserver->GetName().c_str());
+       _new->server = this->ServerInstance->FindServerNamePtr(remoteserver->GetName().c_str());
        _new->ident.assign(params[5], 0, MAXBUF);
        _new->fullname.assign(params[params.size() - 1], 0, MAXBUF);
        _new->registered = REG_ALL;
@@ -118,7 +118,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
                        continue;
 
                /* For each mode thats set, increase counter */
-               ModeHandler* mh = Instance->Modes->FindMode(*v, MODETYPE_USER);
+               ModeHandler* mh = ServerInstance->Modes->FindMode(*v, MODETYPE_USER);
 
                if (mh)
                {
@@ -127,7 +127,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
                                if (paramptr < params.size() - 1)
                                        mh->OnModeChange(_new, _new, NULL, params[paramptr++], true);
                                else
-                                       Instance->Logs->Log("m_spanningtree", DEBUG, "Warning: Broken UID command, expected a parameter for user mode '%c' but there aren't enough parameters in the command!", *v);
+                                       ServerInstance->Logs->Log("m_spanningtree", DEBUG, "Warning: Broken UID command, expected a parameter for user mode '%c' but there aren't enough parameters in the command!", *v);
                        }
                        else
                                mh->OnModeChange(_new, _new, NULL, empty, true);
@@ -135,7 +135,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
                        mh->ChangeCount(1);
                }
                else
-                       Instance->Logs->Log("m_spanningtree", DEBUG, "Warning: Broken UID command, unknown user mode '%c' in the mode string!", *v);
+                       ServerInstance->Logs->Log("m_spanningtree", DEBUG, "Warning: Broken UID command, unknown user mode '%c' in the mode string!", *v);
        }
 
        //_new->ProcessNoticeMasks(params[7].c_str());
@@ -151,21 +151,21 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
 #endif
                _new->SetSockAddr(AF_INET, params[6].c_str(), 0);
 
-       Instance->Users->AddGlobalClone(_new);
+       ServerInstance->Users->AddGlobalClone(_new);
 
        bool dosend = true;
 
-       if ((this->Utils->quiet_bursts && remoteserver->bursting) || this->Instance->SilentULine(_new->server))
+       if ((this->Utils->quiet_bursts && remoteserver->bursting) || this->ServerInstance->SilentULine(_new->server))
                dosend = false;
 
        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());
+               this->ServerInstance->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[params.size() - 1] = ":" + params[params.size() - 1];
        Utils->DoOneToAllButSender(source, "UID", params, source);
 
-       Instance->PI->Introduce(_new);
-       FOREACH_MOD_I(Instance,I_OnPostConnect,OnPostConnect(_new));
+       ServerInstance->PI->Introduce(_new);
+       FOREACH_MOD_I(ServerInstance,I_OnPostConnect,OnPostConnect(_new));
 
        return true;
 }
index b38f25a3820d6a30335eb60e5a454f71fb2256d1..05be18712058f6fbdc2e0c2434adacbaf51b2591 100644 (file)
@@ -30,19 +30,19 @@ bool TreeSocket::Whois(const std::string &prefix, std::deque<std::string> &param
 {
        if (params.size() < 1)
                return true;
-       User* u = this->Instance->FindNick(prefix);
+       User* u = this->ServerInstance->FindNick(prefix);
        if (u)
        {
                // an incoming request
                if (params.size() == 1)
                {
-                       User* x = this->Instance->FindNick(params[0]);
+                       User* x = this->ServerInstance->FindNick(params[0]);
                        if ((x) && (IS_LOCAL(x)))
                        {
                                char signon[MAXBUF];
                                char idle[MAXBUF];
                                snprintf(signon, MAXBUF, "%lu", (unsigned long)x->signon);
-                               snprintf(idle, MAXBUF, "%lu", (unsigned long)abs((long)((x->idle_lastmsg) - Instance->Time())));
+                               snprintf(idle, MAXBUF, "%lu", (unsigned long)abs((long)((x->idle_lastmsg) - ServerInstance->Time())));
                                std::deque<std::string> par;
                                par.push_back(prefix);
                                par.push_back(signon);
@@ -60,7 +60,7 @@ bool TreeSocket::Whois(const std::string &prefix, std::deque<std::string> &param
                else if (params.size() == 3)
                {
                        std::string who_did_the_whois = params[0];
-                       User* who_to_send_to = this->Instance->FindNick(who_did_the_whois);
+                       User* who_to_send_to = this->ServerInstance->FindNick(who_did_the_whois);
                        if ((who_to_send_to) && (IS_LOCAL(who_to_send_to)))
                        {
                                // an incoming reply to a whois we sent out
@@ -69,7 +69,7 @@ bool TreeSocket::Whois(const std::string &prefix, std::deque<std::string> &param
                                unsigned long idle = atoi(params[2].c_str());
                                if ((who_to_send_to) && (IS_LOCAL(who_to_send_to)))
                                {
-                                       do_whois(this->Instance, who_to_send_to, u, signon, idle, nick_whoised.c_str());
+                                       do_whois(this->ServerInstance, who_to_send_to, u, signon, idle, nick_whoised.c_str());
                                }
                        }
                        else