}
};
+/** An XLineFactory specialized to generate shun pointers
+ */
+class ShunFactory : public XLineFactory
+{
+ public:
+ ShunFactory(InspIRCd* Instance) : XLineFactory(Instance, "SHUN") { }
+
+ /** Generate a shun
+ */
+ XLine* Generate(time_t set_time, long duration, const char* source, const char* reason, const char* xline_specific_mask)
+ {
+ return new Shun(ServerInstance, set_time, duration, source, reason, xline_specific_mask);
+ }
+
+ virtual bool AutoApplyToUserList(XLine*)
+ {
+ // No, we don't want to be applied to users automagically.
+ return false;
+ }
+};
+
//typedef std::vector<Shun> shunlist;
class cmd_shun : public Command
class ModuleShun : public Module
{
cmd_shun* mycommand;
+ ShunFactory *f;
public:
ModuleShun(InspIRCd* Me) : Module(Me)
{
+ f = new ShunFactory(ServerInstance);
+ ServerInstance->XLines->RegisterFactory(f);
+
mycommand = new cmd_shun(ServerInstance);
ServerInstance->AddCommand(mycommand);
}
+ virtual ~ModuleShun()
+ {
+ ServerInstance->XLines->UnregisterFactory(f);
+ }
+
void Implements(char* List)
{
List[I_OnPreCommand] = List[I_OnStats] = 1;
return 0;
}
- virtual ~ModuleShun()
- {
- }
-
virtual Version GetVersion()
{
return Version(1,0,0,0,0,API_VERSION);