From 786093b7515e923921f65125ab5bf18f2279f923 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 2 Nov 2007 12:35:18 +0000 Subject: xline gutting, once more. There is no longer an active_lines vector, and no requirement for sorting. Expiry will be cheked on a per-line basis for each positive hit on that line, saving on cpu time. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8457 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/xline.h | 40 +++++++++------------------------------- 1 file changed, 9 insertions(+), 31 deletions(-) (limited to 'include/xline.h') diff --git a/include/xline.h b/include/xline.h index 5de773aaf..7efc6a744 100644 --- a/include/xline.h +++ b/include/xline.h @@ -392,16 +392,10 @@ class CoreExport XLineManager */ InspIRCd* ServerInstance; - /** This functor is used by the std::sort() function to keep all lines in order - */ - static bool XSortComparison (const XLine *one, const XLine *two); - /** Used to hold XLines which have not yet been applied. */ std::vector pending_lines; - std::vector active_lines; - std::map line_factory; GLineFactory* GFact; @@ -469,35 +463,19 @@ class CoreExport XLineManager */ XLineFactory* GetFactory(const char type); - /** Check if a nickname matches a QLine - * @return nick The nick to check against + /** Check if a user matches an XLine + * @param type The type of line to look up + * @param user The user to match against (what is checked is specific to the xline type) * @return The reason for the line if there is a match, or NULL if there is no match */ - QLine* matches_qline(const char* nick); + XLine* MatchesLine(const char type, User* user); - /** Check if a hostname matches a GLine - * @param user The user to check against - * @return The reason for the line if there is a match, or NULL if there is no match - */ - GLine* matches_gline(User* user); - - /** Check if a user's IP matches a ZLine - * @param user The user to check against - * @return The reason for the line if there is a match, or NULL if there is no match - */ - ZLine* matches_zline(User *user); - - /** Check if a hostname matches a KLine - * @param user The user to check against - * @return The reason for the line if there is a match, or NULL if there is no match - */ - KLine* matches_kline(User* user); - - /** Check if a hostname matches a ELine - * @param user The user to check against - * @return The reason for the line if there is a match, or NULL if there is no match + /** Check if a pattern matches an XLine + * @param type The type of line to look up + * @param pattern A pattern string specific to the xline type + * @return The matching XLine if there is a match, or NULL if there is no match */ - ELine* matches_exception(User* user); + XLine* MatchesLine(const char type, const std::string &pattern); /** Expire any lines that should be expired. */ -- cgit v1.2.3