]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Server::GetAdmin, Server::GetServerDescription, Server::GetNetworkName --- *REMOVED*
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 10 Aug 2006 16:16:40 +0000 (16:16 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 10 Aug 2006 16:16:40 +0000 (16:16 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4843 e03df62e-2008-0410-955e-edbf42e46eb7

include/modules.h
src/modules.cpp
src/modules/m_botmode.cpp
src/modules/m_cloaking.cpp
src/modules/m_httpd_stats.cpp
src/modules/m_spanningtree.cpp

index eced8edb28aa261e11c79d9f2b69e76f5140fa6c..f3d7ab18e4ca27c9f9148e25d6d29595fba9c423 100644 (file)
@@ -182,18 +182,6 @@ class Version : public classbase
         Version(int major, int minor, int revision, int build, int flags);
 };
 
-/** Holds /ADMIN data
- *  This class contains the admin details of the local server. It is constructed by class Server,
- *  and has three read-only values, Name, Email and Nick that contain the specified values for the
- *  server where the module is running.
- */
-class Admin : public classbase
-{
- public:
-        const std::string Name, Email, Nick;
-        Admin(std::string name, std::string email, std::string nick);
-};
-
 /** The ModuleMessage class is the base class of Request and Event
  * This class is used to represent a basic data structure which is passed
  * between modules for safe inter-module communications.
@@ -1341,21 +1329,6 @@ class Server : public Extensible
         */
        std::string GetServerName();
 
-       /** Returns the network name, global to all linked servers.
-        */
-       std::string GetNetworkName();
-
-       /** Returns the server description string of the local server
-        */
-       std::string GetServerDescription();
-
-       /** Returns the information of the server as returned by the /ADMIN command.
-        * See the Admin class for further information of the return value. The members
-        * Admin::Nick, Admin::Email and Admin::Name contain the information for the
-        * server where the module is loaded.
-        */
-       Admin GetAdmin();
-
        bool AddMode(ModeHandler* mh, const unsigned char modechar);
 
        bool AddModeWatcher(ModeWatcher* mw);
index 824da10f39adbaa37e60f45a258b0447818f5284..a367f7b8dff9faa7a28df625a6e9083f17040764 100644 (file)
@@ -64,13 +64,6 @@ Version::Version(int major, int minor, int revision, int build, int flags)
 {
 }
 
-// admin is a simple class for holding a server's administrative info
-
-Admin::Admin(std::string name, std::string email, std::string nick)
-: Name(name), Email(email), Nick(nick)
-{
-}
-
 Request::Request(char* anydata, Module* src, Module* dst)
 : data(anydata), source(src), dest(dst)
 {
@@ -427,22 +420,6 @@ std::string Server::GetServerName()
        return ServerInstance->Config->ServerName;
 }
 
-std::string Server::GetNetworkName()
-{
-       return ServerInstance->Config->Network;
-}
-
-std::string Server::GetServerDescription()
-{
-       return ServerInstance->Config->ServerDesc;
-}
-
-Admin Server::GetAdmin()
-{
-       return Admin(ServerInstance->Config->AdminName,ServerInstance->Config->AdminEmail,ServerInstance->Config->AdminNick);
-}
-
-
 bool Server::AddMode(ModeHandler* mh, const unsigned char mode)
 {
        return ServerInstance->ModeGrok->AddMode(mh,mode);
index 1d3d225750d6445d4bd57c0f8e1eca977a052102..0f402a1edd66ad2d887819ede6a41cf52d27b181 100644 (file)
@@ -21,10 +21,14 @@ using namespace std;
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
+#include "helperfuncs.h"
+#include "configreader.h"
 #include "inspircd.h"
 
 /* $ModDesc: Provides support for unreal-style umode +B */
 
+extern InspIRCd* ServerInstance;
+
 class BotMode : public ModeHandler
 {
  public:
@@ -89,7 +93,7 @@ class ModuleBotMode : public Module
        {
                if (dst->IsModeSet('B'))
                {
-                       src->WriteServ("335 "+std::string(src->nick)+" "+std::string(dst->nick)+" :is a \2bot\2 on "+Srv->GetNetworkName());
+                       src->WriteServ("335 "+std::string(src->nick)+" "+std::string(dst->nick)+" :is a \2bot\2 on "+ServerInstance->Config->Network);
                }
        }
 
index b8164d9ba2771f31cef83ce25108a0190b13f43c..5a0e28bb5e94958432591e9d6d9aff7879a5fda8 100644 (file)
@@ -35,6 +35,7 @@
 #ifdef HAS_STDINT
 #include <stdint.h>
 #endif
+#include "configreader.h"
 #include "inspircd.h"
 #include "users.h"
 #include "channels.h"
@@ -42,6 +43,7 @@
 
 /* $ModDesc: Provides masking of user hostnames */
 
+extern InspIRCd* ServerInstance;
 
 /* The four core functions - F1 is optimized somewhat */
 
@@ -382,7 +384,7 @@ class CloakUser : public ModeHandler
                prefix = Conf.ReadValue("cloak","prefix",0);
                if (prefix == "")
                {
-                       prefix = Srv->GetNetworkName();
+                       prefix = ServerInstance->Config->Network;
                }
                if (!key1 && !key2 && !key3 && !key4)
                {
index a8f66b6a771a592964d42de74da8a00d42d86095..8b2ce75f5b628f3251433240e707aa4e3cf2ae8d 100644 (file)
@@ -106,9 +106,9 @@ class ModuleHttpStats : public Module
 
                                data << "<head>";
                                data << "<link rel='stylesheet' href='" << this->stylesheet << "' type='text/css' />";
-                               data << "<title>InspIRCd server statisitics for " << Srv->GetServerName() << " (" << Srv->GetServerDescription() << ")</title>";
+                               data << "<title>InspIRCd server statisitics for " << Srv->GetServerName() << " (" << ServerInstance->Config->ServerDesc << ")</title>";
                                data << "</head><body>";
-                               data << "<h1>InspIRCd server statisitics for " << Srv->GetServerName() << " (" << Srv->GetServerDescription() << ")</h1>";
+                               data << "<h1>InspIRCd server statisitics for " << Srv->GetServerName() << " (" << ServerInstance->Config->ServerDesc << ")</h1>";
 
                                data << "<div class='totals'>";
                                data << "<h2>Totals</h2>";
index 19a21717802a88afeda6984629427df772d0d553..bc8e94b1df20f0f4163d117e3a14015340286f9a 100644 (file)
@@ -756,7 +756,7 @@ class TreeSocket : public InspSocket
                                                }
                                        }
                                        /* found who we're supposed to be connecting to, send the neccessary gubbins. */
-                                       this->WriteLine("SERVER "+Srv->GetServerName()+" "+x->SendPass+" 0 :"+Srv->GetServerDescription());
+                                       this->WriteLine("SERVER "+Srv->GetServerName()+" "+x->SendPass+" 0 :"+ServerInstance->Config->ServerDesc);
                                        return true;
                                }
                        }
@@ -2548,7 +2548,7 @@ class TreeSocket : public InspSocket
                                this->InboundDescription = description;
                                // this is good. Send our details: Our server name and description and hopcount of 0,
                                // along with the sendpass from this block.
-                               this->WriteLine("SERVER "+Srv->GetServerName()+" "+x->SendPass+" 0 :"+Srv->GetServerDescription());
+                               this->WriteLine("SERVER "+Srv->GetServerName()+" "+x->SendPass+" 0 :"+ServerInstance->Config->ServerDesc);
                                // move to the next state, we are now waiting for THEM.
                                this->LinkState = WAIT_AUTH_2;
                                return true;
@@ -3432,7 +3432,7 @@ class ModuleSpanningTree : public Module
                Bindings.clear();
 
                // Create the root of the tree
-               TreeRoot = new TreeServer(Srv->GetServerName(),Srv->GetServerDescription());
+               TreeRoot = new TreeServer(ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc);
 
                ReadConfiguration(true);