From cdaf7ac3781a0ea1bfbfac85c4a428ddea7725f9 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 25 Jan 2006 16:31:05 +0000 Subject: Added PRIORITY_BEFORE and PRIORITY_AFTER (see src/modules/m_hostchange.cpp for how it works, function Prioritize()) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2889 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/modules.cpp') diff --git a/src/modules.cpp b/src/modules.cpp index 2cfb586ca..0a2115916 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -335,6 +335,30 @@ void Server::RemoveSocket(InspSocket* sock) } } +long Server::PriorityAfter(std::string modulename) +{ + for (unsigned int j = 0; j < Config->module_names.size(); j++) + { + if (Config->module_names[j] == modulename) + { + return ((j << 8) | PRIORITY_AFTER); + } + } + return PRIORITY_DONTCARE; +} + +long Server::PriorityBefore(std::string modulename) +{ + for (unsigned int j = 0; j < Config->module_names.size(); j++) + { + if (Config->module_names[j] == modulename) + { + return ((j << 8) | PRIORITY_BEFORE); + } + } + return PRIORITY_DONTCARE; +} + void Server::RehashServer() { WriteOpers("*** Rehashing config file"); -- cgit v1.3.1-10-gc9f91