summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-28 18:33:06 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-28 18:33:06 +0000
commit4840d5e77572f42b710501912d59b5dbb6d2c2af (patch)
tree6ff11fbb04dd9a78ae9befdc66bcdb4ea03aa2a4 /include
parentf35e50f35c0174973802721dc6aef980e2eb8196 (diff)
- Tear out a useless load of XLine clutters that did nothing much except confuse things
- Revert back to early 1.0 design of using a single list for line storage. We'll make this work more efficiently than 1.0 though of course. This simplifies the code for expiry, checking, etc. - Merge a bunch of sort callbacks into a single sort callback for class XLine. - Horribly break apply_lines() for the time being. .. and that's probably it. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8398 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/inspircd.h70
-rw-r--r--include/xline.h56
2 files changed, 10 insertions, 116 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index 320ac6b29..ee1a5120a 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -795,76 +795,6 @@ class CoreExport InspIRCd : public classbase
*/
bool IsValidModuleCommand(const std::string &commandname, int pcnt, User* user);
- /** Add a gline and apply it
- * @param duration How long the line should last
- * @param source Who set the line
- * @param reason The reason for the line
- * @param hostmask The hostmask to set the line against
- */
- void AddGLine(long duration, const std::string &source, const std::string &reason, const std::string &hostmask);
-
- /** Add a qline and apply it
- * @param duration How long the line should last
- * @param source Who set the line
- * @param reason The reason for the line
- * @param nickname The nickmask to set the line against
- */
- void AddQLine(long duration, const std::string &source, const std::string &reason, const std::string &nickname);
-
- /** Add a zline and apply it
- * @param duration How long the line should last
- * @param source Who set the line
- * @param reason The reason for the line
- * @param ipaddr The ip-mask to set the line against
- */
- void AddZLine(long duration, const std::string &source, const std::string &reason, const std::string &ipaddr);
-
- /** Add a kline and apply it
- * @param duration How long the line should last
- * @param source Who set the line
- * @param reason The reason for the line
- * @param hostmask The hostmask to set the line against
- */
- void AddKLine(long duration, const std::string &source, const std::string &reason, const std::string &hostmask);
-
- /** Add an eline
- * @param duration How long the line should last
- * @param source Who set the line
- * @param reason The reason for the line
- * @param hostmask The hostmask to set the line against
- */
- void AddELine(long duration, const std::string &source, const std::string &reason, const std::string &hostmask);
-
- /** Delete a gline
- * @param hostmask The gline to delete
- * @return True if the item was removed
- */
- bool DelGLine(const std::string &hostmask);
-
- /** Delete a qline
- * @param nickname The qline to delete
- * @return True if the item was removed
- */
- bool DelQLine(const std::string &nickname);
-
- /** Delete a zline
- * @param ipaddr The zline to delete
- * @return True if the item was removed
- */
- bool DelZLine(const std::string &ipaddr);
-
- /** Delete a kline
- * @param hostmask The kline to delete
- * @return True if the item was removed
- */
- bool DelKLine(const std::string &hostmask);
-
- /** Delete an eline
- * @param hostmask The kline to delete
- * @return True if the item was removed
- */
- bool DelELine(const std::string &hostmask);
-
/** Return true if the given parameter is a valid nick!user\@host mask
* @param mask A nick!user\@host masak to match against
* @return True i the mask is valid
diff --git a/include/xline.h b/include/xline.h
index 5853e13c4..12b60ee6c 100644
--- a/include/xline.h
+++ b/include/xline.h
@@ -286,25 +286,9 @@ class CoreExport XLineManager
*/
InspIRCd* ServerInstance;
- /** This functor is used by the std::sort() function to keep glines in order
+ /** This functor is used by the std::sort() function to keep all lines in order
*/
- static bool GSortComparison ( const GLine* one, const GLine* two );
-
- /** This functor is used by the std::sort() function to keep elines in order
- */
- static bool ESortComparison ( const ELine* one, const ELine* two );
-
- /** This functor is used by the std::sort() function to keep zlines in order
- */
- static bool ZSortComparison ( const ZLine* one, const ZLine* two );
-
- /** This functor is used by the std::sort() function to keep klines in order
- */
- static bool KSortComparison ( const KLine* one, const KLine* two );
-
- /** This functor is used by the std::sort() function to keep qlines in order
- */
- static bool QSortComparison ( const QLine* one, const QLine* two );
+ static bool XSortComparison (const XLine *one, const XLine *two);
public:
/* Lists for temporary lines with an expiry time */
@@ -323,23 +307,6 @@ class CoreExport XLineManager
/** Temporary ELines */
std::vector<ELine*> elines;
- /* Seperate lists for perm XLines that isnt checked by expiry functions */
-
- /** Permenant KLines */
- std::vector<KLine*> pklines;
-
- /** Permenant GLines */
- std::vector<GLine*> pglines;
-
- /** Permenant ZLines */
- std::vector<ZLine*> pzlines;
-
- /** Permenant QLines */
- std::vector<QLine*> pqlines;
-
- /** Permenant ELines */
- std::vector<ELine*> pelines;
-
/** Constructor
* @param Instance A pointer to the creator object
*/
@@ -434,42 +401,39 @@ class CoreExport XLineManager
* @return nick The nick to check against
* @return The reason for the line if there is a match, or NULL if there is no match
*/
- QLine* matches_qline(const char* nick, bool permonly = false);
+ QLine* matches_qline(const char* nick);
/** 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, bool permonly = false);
+ GLine* matches_gline(User* user);
/** Check if a IP matches a ZLine
* @param ipaddr The IP to check against
* @return The reason for the line if there is a match, or NULL if there is no match
*/
- ZLine* matches_zline(const char* ipaddr, bool permonly = false);
+ ZLine* matches_zline(const char* ipaddr);
/** 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, bool permonly = false);
+ 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
*/
- ELine* matches_exception(User* user, bool permonly = false);
+ ELine* matches_exception(User* user);
- /** Expire any pending non-permenant lines
+ /** Expire any lines that should be expired.
*/
void expire_lines();
- /** Apply any new lines
- * @param What The types of lines to apply, from the set
- * APPLY_GLINES | APPLY_KLINES | APPLY_QLINES | APPLY_ZLINES | APPLY_ALL
- * | APPLY_LOCAL_ONLY
+ /** Apply any new lines that are pending to be applied
*/
- void apply_lines(const int What);
+ void apply_lines();
/** Handle /STATS K
* @param user The username making the query