summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/commands/cs_log.cpp8
-rw-r--r--modules/commands/gl_global.cpp8
-rw-r--r--modules/commands/hs_request.cpp2
-rw-r--r--modules/commands/ms_cancel.cpp2
-rw-r--r--modules/commands/ms_ignore.cpp2
-rw-r--r--modules/commands/ms_read.cpp2
-rw-r--r--modules/commands/ms_rsend.cpp2
-rw-r--r--modules/commands/ms_send.cpp2
-rw-r--r--modules/commands/ms_sendall.cpp2
-rw-r--r--modules/commands/ms_staff.cpp2
-rw-r--r--modules/commands/ns_logout.cpp2
-rw-r--r--modules/commands/os_defcon.cpp36
-rw-r--r--modules/protocol/bahamut.cpp8
-rw-r--r--modules/protocol/hybrid.cpp8
-rw-r--r--modules/protocol/inspircd11.cpp8
-rw-r--r--modules/protocol/plexus.cpp8
-rw-r--r--modules/protocol/unreal.cpp8
-rw-r--r--modules/pseudoclients/global.cpp4
-rw-r--r--modules/pseudoclients/global.h2
-rw-r--r--modules/pseudoclients/memoserv.h2
-rw-r--r--modules/pseudoclients/nickserv.cpp2
-rw-r--r--modules/pseudoclients/nickserv.h2
22 files changed, 60 insertions, 62 deletions
diff --git a/modules/commands/cs_log.cpp b/modules/commands/cs_log.cpp
index 4965ab561..18270a1a2 100644
--- a/modules/commands/cs_log.cpp
+++ b/modules/commands/cs_log.cpp
@@ -181,10 +181,12 @@ public:
class CSLog : public Module
{
+ ServiceReference<MemoServService> MSService;
CommandCSLog commandcslog;
public:
- CSLog(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE), commandcslog(this)
+ CSLog(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
+ MSService("MemoServService", "MemoServ"), commandcslog(this)
{
this->SetAuthor("Anope");
@@ -212,8 +214,8 @@ class CSLog : public Module
}
else if (log->method.equals_ci("NOTICE") && l->ci->c && l->ci->bi && l->ci->c->FindUser(l->ci->bi) != NULL)
IRCD->SendNotice(l->ci->bi, log->extra + l->ci->c->name, "%s", buffer.c_str());
- else if (log->method.equals_ci("MEMO") && MemoServService && l->ci->WhoSends() != NULL)
- MemoServService->Send(l->ci->WhoSends()->nick, l->ci->name, buffer, true);
+ else if (log->method.equals_ci("MEMO") && MSService && l->ci->WhoSends() != NULL)
+ MSService->Send(l->ci->WhoSends()->nick, l->ci->name, buffer, true);
}
}
}
diff --git a/modules/commands/gl_global.cpp b/modules/commands/gl_global.cpp
index 2be0164e3..5fb2c9b35 100644
--- a/modules/commands/gl_global.cpp
+++ b/modules/commands/gl_global.cpp
@@ -16,8 +16,10 @@
class CommandGLGlobal : public Command
{
+ ServiceReference<GlobalService> GService;
+
public:
- CommandGLGlobal(Module *creator) : Command(creator, "global/global", 1, 1)
+ CommandGLGlobal(Module *creator) : Command(creator, "global/global", 1, 1), GService("GlobalService", "Global")
{
this->SetDesc(_("Send a message to all users"));
this->SetSyntax(_("\037message\037"));
@@ -27,12 +29,12 @@ class CommandGLGlobal : public Command
{
const Anope::string &msg = params[0];
- if (!GlobalService)
+ if (!GService)
source.Reply("No global reference, is gl_main loaded?");
else
{
Log(LOG_ADMIN, source, this);
- GlobalService->SendGlobal(Global, source.GetNick(), msg);
+ GService->SendGlobal(Global, source.GetNick(), msg);
}
}
diff --git a/modules/commands/hs_request.cpp b/modules/commands/hs_request.cpp
index 6cd2e6811..a5dcfc4cc 100644
--- a/modules/commands/hs_request.cpp
+++ b/modules/commands/hs_request.cpp
@@ -18,6 +18,8 @@
#include "module.h"
#include "memoserv.h"
+static ServiceReference<MemoServService> MemoServService("MemoServService", "MemoServ");
+
static bool HSRequestMemoUser = false;
static bool HSRequestMemoOper = false;
diff --git a/modules/commands/ms_cancel.cpp b/modules/commands/ms_cancel.cpp
index 8949baf17..68a2289b7 100644
--- a/modules/commands/ms_cancel.cpp
+++ b/modules/commands/ms_cancel.cpp
@@ -14,6 +14,8 @@
#include "module.h"
#include "memoserv.h"
+static ServiceReference<MemoServService> MemoServService("MemoServService", "MemoServ");
+
class CommandMSCancel : public Command
{
public:
diff --git a/modules/commands/ms_ignore.cpp b/modules/commands/ms_ignore.cpp
index 465714852..ceb4f40d0 100644
--- a/modules/commands/ms_ignore.cpp
+++ b/modules/commands/ms_ignore.cpp
@@ -15,6 +15,8 @@
#include "module.h"
#include "memoserv.h"
+static ServiceReference<MemoServService> MemoServService("MemoServService", "MemoServ");
+
class CommandMSIgnore : public Command
{
public:
diff --git a/modules/commands/ms_read.cpp b/modules/commands/ms_read.cpp
index 6d5adfb05..5e080f88c 100644
--- a/modules/commands/ms_read.cpp
+++ b/modules/commands/ms_read.cpp
@@ -14,6 +14,8 @@
#include "module.h"
#include "memoserv.h"
+static ServiceReference<MemoServService> MemoServService("MemoServService", "MemoServ");
+
static void rsend_notify(CommandSource &source, MemoInfo *mi, Memo *m, const Anope::string &targ)
{
/* Only send receipt if memos are allowed */
diff --git a/modules/commands/ms_rsend.cpp b/modules/commands/ms_rsend.cpp
index b08b9be85..3787e9428 100644
--- a/modules/commands/ms_rsend.cpp
+++ b/modules/commands/ms_rsend.cpp
@@ -14,6 +14,8 @@
#include "module.h"
#include "memoserv.h"
+static ServiceReference<MemoServService> MemoServService("MemoServService", "MemoServ");
+
class CommandMSRSend : public Command
{
public:
diff --git a/modules/commands/ms_send.cpp b/modules/commands/ms_send.cpp
index 42024227e..816d0336c 100644
--- a/modules/commands/ms_send.cpp
+++ b/modules/commands/ms_send.cpp
@@ -14,6 +14,8 @@
#include "module.h"
#include "memoserv.h"
+static ServiceReference<MemoServService> MemoServService("MemoServService", "MemoServ");
+
class CommandMSSend : public Command
{
public:
diff --git a/modules/commands/ms_sendall.cpp b/modules/commands/ms_sendall.cpp
index 5ade6722b..cba0a160e 100644
--- a/modules/commands/ms_sendall.cpp
+++ b/modules/commands/ms_sendall.cpp
@@ -14,6 +14,8 @@
#include "module.h"
#include "memoserv.h"
+static ServiceReference<MemoServService> MemoServService("MemoServService", "MemoServ");
+
class CommandMSSendAll : public Command
{
public:
diff --git a/modules/commands/ms_staff.cpp b/modules/commands/ms_staff.cpp
index a1fbdf65d..d19dbf8b6 100644
--- a/modules/commands/ms_staff.cpp
+++ b/modules/commands/ms_staff.cpp
@@ -14,6 +14,8 @@
#include "module.h"
#include "memoserv.h"
+static ServiceReference<MemoServService> MemoServService("MemoServService", "MemoServ");
+
class CommandMSStaff : public Command
{
public:
diff --git a/modules/commands/ns_logout.cpp b/modules/commands/ns_logout.cpp
index 5519e6ae8..133d9fc23 100644
--- a/modules/commands/ns_logout.cpp
+++ b/modules/commands/ns_logout.cpp
@@ -14,6 +14,8 @@
#include "module.h"
#include "nickserv.h"
+static ServiceReference<NickServService> NickServService("NickServService", "NickServ");
+
class CommandNSLogout : public Command
{
public:
diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp
index 4bcf9de38..6d043b17c 100644
--- a/modules/commands/os_defcon.cpp
+++ b/modules/commands/os_defcon.cpp
@@ -98,12 +98,11 @@ struct DefconConfig
static DefconConfig DConfig;
-/**************************************************************************/
-
-void defcon_sendlvls(CommandSource &source);
-void runDefCon();
+static void runDefCon();
static Anope::string defconReverseModes(const Anope::string &modes);
+static ServiceReference<GlobalService> GlobalService("GlobalService", "Global");
+
class DefConTimeout : public CallBack
{
int level;
@@ -556,34 +555,7 @@ class OSDefcon : public Module
}
};
-/**
- * Send a message to the oper about which precautions are "active" for this level
- **/
-void defcon_sendlvls(CommandSource &source)
-{
- if (DConfig.Check(DEFCON_NO_NEW_CHANNELS))
- source.Reply(_("* No new channel registrations"));
- if (DConfig.Check(DEFCON_NO_NEW_NICKS))
- source.Reply(_("* No new nick registrations"));
- if (DConfig.Check(DEFCON_NO_MLOCK_CHANGE))
- source.Reply(_("* No MLOCK changes"));
- if (DConfig.Check(DEFCON_FORCE_CHAN_MODES) && !DConfig.chanmodes.empty())
- source.Reply(_("* Force Chan Modes (%s) to be set on all channels"), DConfig.chanmodes.c_str());
- if (DConfig.Check(DEFCON_REDUCE_SESSION))
- source.Reply(_("* Use the reduced session limit of %d"), DConfig.sessionlimit);
- if (DConfig.Check(DEFCON_NO_NEW_CLIENTS))
- source.Reply(_("* Kill any NEW clients connecting"));
- if (DConfig.Check(DEFCON_OPER_ONLY))
- source.Reply(_("* Ignore any non-opers with message"));
- if (DConfig.Check(DEFCON_SILENT_OPER_ONLY))
- source.Reply(_("* Silently ignore non-opers"));
- if (DConfig.Check(DEFCON_AKILL_NEW_CLIENTS))
- source.Reply(_("* AKILL any new clients connecting"));
- if (DConfig.Check(DEFCON_NO_NEW_MEMOS))
- source.Reply(_("* No new memos sent"));
-}
-
-void runDefCon()
+static void runDefCon()
{
if (DConfig.Check(DEFCON_FORCE_CHAN_MODES))
{
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp
index 8ca8ded7b..56e45d6f9 100644
--- a/modules/protocol/bahamut.cpp
+++ b/modules/protocol/bahamut.cpp
@@ -371,7 +371,9 @@ struct IRCDMessageMode : IRCDMessage
*/
struct IRCDMessageNick : IRCDMessage
{
- IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
+ ServiceReference<NickServService> NSService;
+
+ IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2), NSService("NickServService", "NickServ") { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
@@ -388,8 +390,8 @@ struct IRCDMessageNick : IRCDMessage
try
{
NickAlias *na;
- if (NickServService && user->signon == convertTo<time_t>(params[7]) && (na = NickAlias::Find(user->nick)))
- NickServService->Login(user, na);
+ if (NSService && user->signon == convertTo<time_t>(params[7]) && (na = NickAlias::Find(user->nick)))
+ NSService->Login(user, na);
}
catch (const ConvertException &) { }
}
diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp
index bc4fd55f4..a4711c708 100644
--- a/modules/protocol/hybrid.cpp
+++ b/modules/protocol/hybrid.cpp
@@ -485,7 +485,9 @@ struct IRCDMessageTMode : IRCDMessage
struct IRCDMessageUID : IRCDMessage
{
- IRCDMessageUID(Module *creator) : IRCDMessage(creator, "UID", 10) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
+ ServiceReference<NickServService> NSService;
+
+ IRCDMessageUID(Module *creator) : IRCDMessage(creator, "UID", 10), NSService("NickServService", "NickServ") { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
/* 0 1 2 3 4 5 6 7 8 9 */
/* :0MC UID Steve 1 1350157102 +oi ~steve resolved.host 10.0.0.1 0MCAAAAAB 1350157108 :Mining all the time */
@@ -502,11 +504,11 @@ struct IRCDMessageUID : IRCDMessage
params[9], params[2].is_pos_number_only() ? convertTo<time_t>(params[2]) : 0,
params[3], params[7]);
- if (NickServService && params[8] != "0")
+ if (NSService && params[8] != "0")
{
NickAlias *na = NickAlias::Find(params[8]);
if (na != NULL)
- NickServService->Login(user, na);
+ NSService->Login(user, na);
}
}
};
diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp
index 5a6d19af7..024e70cb9 100644
--- a/modules/protocol/inspircd11.cpp
+++ b/modules/protocol/inspircd11.cpp
@@ -752,7 +752,9 @@ struct IRCDMessageMode : IRCDMessage
struct IRCDMessageNick : IRCDMessage
{
- IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
+ ServiceReference<NickServService> NSService;
+
+ IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 1), NSService("NickServService", "NickServ") { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
@@ -761,12 +763,12 @@ struct IRCDMessageNick : IRCDMessage
time_t ts = Anope::string(params[0]).is_pos_number_only() ? convertTo<time_t>(params[0]) : Anope::CurTime;
User *user = new User(params[1], params[4], params[2], params[3], params[6], source.GetServer(), params[7], ts, params[5]);
- if (NickServService)
+ if (NSService)
{
NickAlias *na = NickAlias::Find(user->nick);
Anope::string *svidbuf = na ? na->nc->GetExt<ExtensibleItemClass<Anope::string> *>("authenticationtoken") : NULL;
if (na && svidbuf && *svidbuf == params[0])
- NickServService->Login(user, na);
+ NSService->Login(user, na);
}
}
else if (params.size() == 1 && source.GetUser())
diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp
index 5cb248bab..448c30042 100644
--- a/modules/protocol/plexus.cpp
+++ b/modules/protocol/plexus.cpp
@@ -238,7 +238,9 @@ struct IRCDMessageServer : IRCDMessage
struct IRCDMessageUID : IRCDMessage
{
- IRCDMessageUID(Module *creator) : IRCDMessage(creator, "UID", 11) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
+ ServiceReference<NickServService> NSService;
+
+ IRCDMessageUID(Module *creator) : IRCDMessage(creator, "UID", 11), NSService("NickServService", "NickServ") { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
/*
params[0] = nick
@@ -274,11 +276,11 @@ struct IRCDMessageUID : IRCDMessage
User *user = new User(params[0], params[4], params[9], params[5], ip, source.GetServer(), params[10], ts, params[3], params[7]);
try
{
- if (NickServService && params[8].is_pos_number_only() && convertTo<time_t>(params[8]) == user->timestamp)
+ if (NSService && params[8].is_pos_number_only() && convertTo<time_t>(params[8]) == user->timestamp)
{
NickAlias *na = NickAlias::Find(user->nick);
if (na)
- NickServService->Login(user, na);
+ NSService->Login(user, na);
}
}
catch (const ConvertException &) { }
diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp
index bba15deec..4621b3bc4 100644
--- a/modules/protocol/unreal.cpp
+++ b/modules/protocol/unreal.cpp
@@ -750,7 +750,9 @@ struct IRCDMessageNetInfo : IRCDMessage
struct IRCDMessageNick : IRCDMessage
{
- IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
+ ServiceReference<NickServService> NSService;
+
+ IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2), NSService("NickServService", "NickServ") { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
/*
** NICK - new
@@ -817,8 +819,8 @@ struct IRCDMessageNick : IRCDMessage
na = NickAlias::Find(params[6]);
}
- if (na && NickServService)
- NickServService->Login(user, na);
+ if (na && NSService)
+ NSService->Login(user, na);
}
else
source.GetUser()->ChangeNick(params[0]);
diff --git a/modules/pseudoclients/global.cpp b/modules/pseudoclients/global.cpp
index 228da91a5..e146544f4 100644
--- a/modules/pseudoclients/global.cpp
+++ b/modules/pseudoclients/global.cpp
@@ -75,13 +75,13 @@ class GlobalCore : public Module
void OnRestart() anope_override
{
if (Config->GlobalOnCycle)
- GlobalService->SendGlobal(Global, "", Config->GlobalOnCycleMessage);
+ this->myglobalservice.SendGlobal(Global, "", Config->GlobalOnCycleMessage);
}
void OnShutdown() anope_override
{
if (Config->GlobalOnCycle)
- GlobalService->SendGlobal(Global, "", Config->GlobalOnCycleMessage);
+ this->myglobalservice.SendGlobal(Global, "", Config->GlobalOnCycleMessage);
}
void OnNewServer(Server *s) anope_override
diff --git a/modules/pseudoclients/global.h b/modules/pseudoclients/global.h
index 7a2dc1830..fccd96558 100644
--- a/modules/pseudoclients/global.h
+++ b/modules/pseudoclients/global.h
@@ -14,7 +14,5 @@ class GlobalService : public Service
virtual void SendGlobal(const BotInfo *sender, const Anope::string &source, const Anope::string &message) = 0;
};
-static ServiceReference<GlobalService> GlobalService("GlobalService", "Global");
-
#endif // GLOBAL_H
diff --git a/modules/pseudoclients/memoserv.h b/modules/pseudoclients/memoserv.h
index 35a187d53..e314c7208 100644
--- a/modules/pseudoclients/memoserv.h
+++ b/modules/pseudoclients/memoserv.h
@@ -35,7 +35,5 @@ class MemoServService : public Service
virtual void Check(User *u) = 0;
};
-static ServiceReference<MemoServService> MemoServService("MemoServService", "MemoServ");
-
#endif // MEMOSERV_H
diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp
index 8a56c86ae..ba2f47478 100644
--- a/modules/pseudoclients/nickserv.cpp
+++ b/modules/pseudoclients/nickserv.cpp
@@ -328,7 +328,7 @@ class NickServCore : public Module
{
User *u = it->second;
if (u->server == s && !u->IsIdentified())
- NickServService->Validate(u);
+ this->mynickserv.Validate(u);
}
}
diff --git a/modules/pseudoclients/nickserv.h b/modules/pseudoclients/nickserv.h
index 1037522ce..63923de2b 100644
--- a/modules/pseudoclients/nickserv.h
+++ b/modules/pseudoclients/nickserv.h
@@ -10,7 +10,5 @@ class NickServService : public Service
virtual void Login(User *u, NickAlias *na) = 0;
};
-static ServiceReference<NickServService> NickServService("NickServService", "NickServ");
-
#endif // NICKSERV_H