]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_park.cpp
Speaking of forgetting things, someone forgot to change the name of the function
[user/henk/code/inspircd.git] / src / modules / m_park.cpp
index f6e2b69ac322edcde852620e703885fb5dea13f1..c1c8a055b77cfa1209893bde87209afcb6f55195 100644 (file)
@@ -21,11 +21,11 @@ using namespace std;
 #include <vector>
 #include "users.h"
 #include "channels.h"
-#include "helperfuncs.h"
+
 #include "modules.h"
 #include "inspircd.h"
 
-extern InspIRCd* ServerInstance;
+
 
 /* $ModDesc: Provides support for user parking/unparking */
 
@@ -49,7 +49,7 @@ class parkedinfo : public parking
        time_t parktime;
 };
 
-static Server *Srv;
+
 typedef std::vector<awaymsg> awaylog;
 typedef std::vector<parkedinfo> parkinfo;
 parkinfo pinfo;
@@ -61,7 +61,7 @@ parkedinfo pi;
 class cmd_park : public command_t
 {
  public:
      cmd_park () : command_t("PARK", 0, 0)
cmd_park (InspIRCd* Instance) : command_t(Instance,"PARK", 0, 0)
        {
                this->source = "m_park.so";
        }
@@ -106,7 +106,7 @@ class cmd_park : public command_t
 class cmd_parkstats : public command_t
 {
  public:
      cmd_parkstats () : command_t("PARKSTATS", 'o', 0)
cmd_parkstats (InspIRCd* Instance) : command_t(Instance,"PARKSTATS", 'o', 0)
        {
                this->source = "m_park.so";
        }
@@ -122,7 +122,7 @@ class cmd_parkstats : public command_t
 class cmd_unpark : public command_t
 {
  public:
      cmd_unpark () : command_t("UNPARK", 0, 2)
cmd_unpark (InspIRCd* Instance) : command_t(Instance,"UNPARK", 0, 2)
        {
                this->source = "m_park.so";
                syntax = "<nick> <key>";
@@ -219,7 +219,7 @@ class ModulePark : public Module
  public:
        virtual void ReadSettings()
        {
-               Conf = new ConfigReader;
+               Conf = new ConfigReader(ServerInstance);
                ParkMaxTime = Conf->ReadInteger("park","maxtime",0,true);
                ConcurrentParks = Conf->ReadInteger("park","maxperip",0,true);
                ParkMaxMsgs = Conf->ReadInteger("park","maxmessages",0,true);
@@ -232,12 +232,12 @@ class ModulePark : public Module
                
                pinfo.clear();
                this->ReadSettings();
-               cmd1 = new cmd_park();
-               cmd2 = new cmd_unpark();
-               cmd3 = new cmd_parkstats();
-               Srv->AddCommand(cmd1);
-               Srv->AddCommand(cmd2);
-               Srv->AddCommand(cmd3);
+               cmd1 = new cmd_park(ServerInstance);
+               cmd2 = new cmd_unpark(ServerInstance);
+               cmd3 = new cmd_parkstats(ServerInstance);
+               ServerInstance->AddCommand(cmd1);
+               ServerInstance->AddCommand(cmd2);
+               ServerInstance->AddCommand(cmd3);
        }
 
        virtual ~ModulePark()