summaryrefslogtreecommitdiff
path: root/src/modules/m_timedbans.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-10 23:53:48 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-10 23:53:48 +0000
commitd0b4bb3811458aa335857514e4cbb95d5c84f433 (patch)
treee3a88027d3ef17a26a6d1535213244536ca4dcbd /src/modules/m_timedbans.cpp
parent55e2180b4a5fb65faac05ce4956ab1e5515fa9e5 (diff)
Last of Server:: methods moved to InspIRCd::. Server:: removed.
This will need a real good tidyup later, because now everything is in the right place, but its a mess because for now i threw them into place (e.g. space indenting, etc) Next on the todo: Make command handlers have a ServerInstance (gank!) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4861 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_timedbans.cpp')
-rw-r--r--src/modules/m_timedbans.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index a0b5fe95f..a778ab4c6 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -28,7 +28,7 @@ using namespace std;
#include "configreader.h"
#include "inspircd.h"
-static Server *Srv;
+
extern InspIRCd* ServerInstance;
class TimedBan : public classbase
@@ -59,7 +59,7 @@ class cmd_tban : public command_t
int cm = channel->GetStatus(user);
if ((cm == STATUS_HOP) || (cm == STATUS_OP))
{
- if (!Srv->IsValidMask(parameters[2]))
+ if (!ServerInstance->IsValidMask(parameters[2]))
{
user->WriteServ("NOTICE "+std::string(user->nick)+" :Invalid ban mask");
return;
@@ -74,14 +74,14 @@ class cmd_tban : public command_t
}
TimedBan T;
std::string channelname = parameters[0];
- unsigned long expire = Srv->CalcDuration(parameters[1]) + time(NULL);
- if (Srv->CalcDuration(parameters[1]) < 1)
+ unsigned long expire = ServerInstance->CalcDuration(parameters[1]) + time(NULL);
+ if (ServerInstance->CalcDuration(parameters[1]) < 1)
{
user->WriteServ("NOTICE "+std::string(user->nick)+" :Invalid ban time");
return;
}
char duration[MAXBUF];
- snprintf(duration,MAXBUF,"%lu",Srv->CalcDuration(parameters[1]));
+ snprintf(duration,MAXBUF,"%lu",ServerInstance->CalcDuration(parameters[1]));
std::string mask = parameters[2];
const char *setban[32];
setban[0] = parameters[0];
@@ -89,7 +89,7 @@ class cmd_tban : public command_t
setban[2] = parameters[2];
// use CallCommandHandler to make it so that the user sets the mode
// themselves
- Srv->CallCommandHandler("MODE",setban,3,user);
+ ServerInstance->CallCommandHandler("MODE",setban,3,user);
/* Check if the ban was actually added (e.g. banlist was NOT full) */
bool was_added = false;
for (BanList::iterator i = channel->bans.begin(); i != channel->bans.end(); i++)
@@ -121,7 +121,7 @@ class ModuleTimedBans : public Module
{
mycommand = new cmd_tban();
- Srv->AddCommand(mycommand);
+ ServerInstance->AddCommand(mycommand);
TimedBanList.clear();
}
@@ -177,7 +177,7 @@ class ModuleTimedBans : public Module
userrec* temp = new userrec(ServerInstance);
temp->fd = FD_MAGIC_NUMBER;
temp->server = "";
- Srv->SendMode(setban,3,temp);
+ ServerInstance->SendMode(setban,3,temp);
/* FIX: Send mode remotely*/
std::deque<std::string> n;
n.push_back(i->channel);