summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/xline.h40
-rw-r--r--src/xline.cpp12
2 files changed, 51 insertions, 1 deletions
diff --git a/include/xline.h b/include/xline.h
index edde8d91a..ff33da7d2 100644
--- a/include/xline.h
+++ b/include/xline.h
@@ -373,6 +373,9 @@ class InspIRCd;
class GLineFactory;
class ELineFactory;
+class QLineFactory;
+class ZLineFactory;
+class KLineFactory;
/** XLineManager is a class used to manage glines, klines, elines, zlines and qlines.
*/
@@ -397,6 +400,9 @@ class CoreExport XLineManager
GLineFactory* GFact;
ELineFactory* EFact;
+ KLineFactory* KFact;
+ QLineFactory* QFact;
+ ZLineFactory* ZFact;
public:
@@ -573,6 +579,38 @@ class CoreExport ELineFactory : public XLineFactory
}
};
+class CoreExport KLineFactory : public XLineFactory
+{
+ public:
+ KLineFactory(InspIRCd* Instance) : XLineFactory(Instance, 'K') { }
-#endif
+ XLine* Generate(time_t set_time, long duration, const char* source, const char* reason, const char* xline_specific_mask)
+ {
+ IdentHostPair ih = ServerInstance->XLines->IdentSplit(xline_specific_mask);
+ return new KLine(ServerInstance, set_time, duration, source, reason, ih.first.c_str(), ih.second.c_str());
+ }
+};
+class CoreExport QLineFactory : public XLineFactory
+{
+ public:
+ QLineFactory(InspIRCd* Instance) : XLineFactory(Instance, 'Q') { }
+
+ XLine* Generate(time_t set_time, long duration, const char* source, const char* reason, const char* xline_specific_mask)
+ {
+ return new QLine(ServerInstance, set_time, duration, source, reason, xline_specific_mask);
+ }
+};
+
+class CoreExport ZLineFactory : public XLineFactory
+{
+ public:
+ ZLineFactory(InspIRCd* Instance) : XLineFactory(Instance, 'Z') { }
+
+ XLine* Generate(time_t set_time, long duration, const char* source, const char* reason, const char* xline_specific_mask)
+ {
+ return new ZLine(ServerInstance, set_time, duration, source, reason, xline_specific_mask);
+ }
+};
+
+#endif
diff --git a/src/xline.cpp b/src/xline.cpp
index a853eb35f..1f2782c4d 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -424,18 +424,30 @@ XLineManager::XLineManager(InspIRCd* Instance) : ServerInstance(Instance)
{
GFact = new GLineFactory(Instance);
EFact = new ELineFactory(Instance);
+ KFact = new KLineFactory(Instance);
+ QFact = new QLineFactory(Instance);
+ ZFact = new ZLineFactory(Instance);
RegisterFactory(GFact);
RegisterFactory(EFact);
+ RegisterFactory(KFact);
+ RegisterFactory(QFact);
+ RegisterFactory(ZFact);
}
XLineManager::~XLineManager()
{
UnregisterFactory(GFact);
UnregisterFactory(EFact);
+ UnregisterFactory(KFact);
+ UnregisterFactory(QFact);
+ UnregisterFactory(ZFact);
delete GFact;
delete EFact;
+ delete KFact;
+ delete QFact;
+ delete ZFact;
}
void XLine::Apply(User* u)