diff options
| author | Adam <Adam@anope.org> | 2013-07-01 22:17:52 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2013-07-01 22:17:52 -0400 |
| commit | 1a3d9a016d3adc49788bbff73aac9b3b5ea85b17 (patch) | |
| tree | c0ecf92ed768473bc82ff64a7fce827245f37ba9 /include/modules | |
| parent | 518182ac9204f815258b0de91b3f884d8efa1502 (diff) | |
Change extensible keys to require explicitly having a type defined for it. Completely modularize more features like bs_kick, entrymsg, log, mode, etc. Move fantasy to its own module. Move greet to its own module.
Diffstat (limited to 'include/modules')
| -rw-r--r-- | include/modules/bs_badwords.h | 70 | ||||
| -rw-r--r-- | include/modules/bs_kick.h | 45 | ||||
| -rw-r--r-- | include/modules/cs_log.h | 41 | ||||
| -rw-r--r-- | include/modules/cs_mode.h | 87 | ||||
| -rw-r--r-- | include/modules/cs_suspend.h | 19 | ||||
| -rw-r--r-- | include/modules/ns_cert.h | 61 | ||||
| -rw-r--r-- | include/modules/ns_suspend.h | 19 |
7 files changed, 342 insertions, 0 deletions
diff --git a/include/modules/bs_badwords.h b/include/modules/bs_badwords.h new file mode 100644 index 000000000..4275226cc --- /dev/null +++ b/include/modules/bs_badwords.h @@ -0,0 +1,70 @@ +/* BotServ core functions + * + * (C) 2003-2013 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + * + * + */ + +/** Flags for badwords + */ +enum BadWordType +{ + /* Always kicks if the word is said */ + BW_ANY, + /* User must way the entire word */ + BW_SINGLE, + /* The word has to start with the badword */ + BW_START, + /* The word has to end with the badword */ + BW_END +}; + +/* Structure used to contain bad words. */ +struct BadWord +{ + Anope::string chan; + Anope::string word; + BadWordType type; + + protected: + BadWord() { } +}; + +struct BadWords +{ + /** Add a badword to the badword list + * @param word The badword + * @param type The type (SINGLE START END) + * @return The badword + */ + virtual BadWord* AddBadWord(const Anope::string &word, BadWordType type) = 0; + + /** Get a badword structure by index + * @param index The index + * @return The badword + */ + virtual BadWord* GetBadWord(unsigned index) const = 0; + + /** Get how many badwords are on this channel + * @return The number of badwords in the vector + */ + virtual unsigned GetBadWordCount() const = 0; + + /** Remove a badword + * @param index The index of the badword + */ + virtual void EraseBadWord(unsigned index) = 0; + + /** Clear all badwords from the channel + */ + virtual void ClearBadWords() = 0; + + virtual void Check() = 0; +}; + diff --git a/include/modules/bs_kick.h b/include/modules/bs_kick.h new file mode 100644 index 000000000..e1c43cc8c --- /dev/null +++ b/include/modules/bs_kick.h @@ -0,0 +1,45 @@ +/* BotServ core functions + * + * (C) 2003-2013 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + * + * + */ + +/* Indices for TTB (Times To Ban) */ +enum +{ + TTB_BOLDS, + TTB_COLORS, + TTB_REVERSES, + TTB_UNDERLINES, + TTB_BADWORDS, + TTB_CAPS, + TTB_FLOOD, + TTB_REPEAT, + TTB_ITALICS, + TTB_AMSGS, + TTB_SIZE +}; + +struct KickerData +{ + bool amsgs, badwords, bolds, caps, colors, flood, italics, repeat, reverses, underlines; + int16_t ttb[TTB_SIZE]; /* Times to ban for each kicker */ + int16_t capsmin, capspercent; /* For CAPS kicker */ + int16_t floodlines, floodsecs; /* For FLOOD kicker */ + int16_t repeattimes; /* For REPEAT kicker */ + + bool dontkickops, dontkickvoices; + + protected: + KickerData() { } + + public: + virtual void Check(ChannelInfo *ci) = 0; +}; diff --git a/include/modules/cs_log.h b/include/modules/cs_log.h new file mode 100644 index 000000000..555a44e50 --- /dev/null +++ b/include/modules/cs_log.h @@ -0,0 +1,41 @@ +/* ChanServ core functions + * + * (C) 2003-2013 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + */ + +struct LogSetting +{ + Anope::string chan; + /* Our service name of the command */ + Anope::string service_name; + /* The name of the client the command is on */ + Anope::string command_service; + /* Name of the command to the user, can have spaces */ + Anope::string command_name; + Anope::string method, extra; + Anope::string creator; + time_t created; + + protected: + LogSetting() { } +}; + +struct LogSettings : Serialize::Checker<std::vector<LogSetting *> > +{ + typedef std::vector<LogSetting *>::iterator iterator; + + protected: + LogSettings() : Serialize::Checker<std::vector<LogSetting *> >("LogSetting") + { + } + + public: + virtual LogSetting *Create() = 0; +}; + diff --git a/include/modules/cs_mode.h b/include/modules/cs_mode.h new file mode 100644 index 000000000..4d016e672 --- /dev/null +++ b/include/modules/cs_mode.h @@ -0,0 +1,87 @@ +/* ChanServ core functions + * + * (C) 2003-2013 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + */ + +struct ModeLock +{ + Anope::string ci; + bool set; + Anope::string name; + Anope::string param; + Anope::string setter; + time_t created; + + protected: + ModeLock() { } +}; + +struct ModeLocks +{ + typedef std::vector<ModeLock *> ModeList; + + /** Check if a mode is mlocked + * @param mode The mode + * @param An optional param + * @param status True to check mlock on, false for mlock off + * @return true on success, false on fail + */ + virtual bool HasMLock(ChannelMode *mode, const Anope::string ¶m, bool status) const = 0; + + /** Set a mlock + * @param mode The mode + * @param status True for mlock on, false for mlock off + * @param param An optional param arg for + mlocked modes + * @param setter Who is setting the mlock + * @param created When the mlock was created + * @return true on success, false on failure (module blocking) + */ + virtual bool SetMLock(ChannelMode *mode, bool status, const Anope::string ¶m = "", Anope::string setter = "", time_t created = Anope::CurTime) = 0; + + /** Remove a mlock + * @param mode The mode + * @param status True for mlock on, false for mlock off + * @param param The param of the mode, required if it is a list or status mode + * @return true on success, false on failure + */ + virtual bool RemoveMLock(ChannelMode *mode, bool status, const Anope::string ¶m = "") = 0; + + virtual void RemoveMLock(ModeLock *mlock) = 0; + + /** Clear all mlocks on the channel + */ + virtual void ClearMLock() = 0; + + /** Get all of the mlocks for this channel + * @return The mlocks + */ + virtual const ModeList &GetMLock() const = 0; + + /** Get a list of mode locks on a channel + * @param name The mode name to get a list of + * @return a list of mlocks for the given mode + */ + virtual std::list<ModeLock *> GetModeLockList(const Anope::string &name) = 0; + + /** Get details for a specific mlock + * @param mname The mode name + * @param An optional param to match with + * @return The MLock, if any + */ + virtual const ModeLock *GetMLock(const Anope::string &mname, const Anope::string ¶m = "") = 0; + + /** Get the current mode locks as a string + * @param complete True to show mlock parameters aswell + * @return A string of mode locks, eg: +nrt + */ + virtual Anope::string GetMLockAsString(bool complete) const = 0; + + virtual void Check() = 0; +}; + diff --git a/include/modules/cs_suspend.h b/include/modules/cs_suspend.h new file mode 100644 index 000000000..dbdd3b9e9 --- /dev/null +++ b/include/modules/cs_suspend.h @@ -0,0 +1,19 @@ +/* ChanServ core functions + * + * (C) 2003-2013 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + */ + +struct CSSuspendInfo +{ + Anope::string chan, by, reason; + time_t time, expires; + + protected: + CSSuspendInfo() { } +}; diff --git a/include/modules/ns_cert.h b/include/modules/ns_cert.h new file mode 100644 index 000000000..8587cdfb2 --- /dev/null +++ b/include/modules/ns_cert.h @@ -0,0 +1,61 @@ +/* NickServ core functions + * + * (C) 2003-2013 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + */ + +struct NSCertList +{ + protected: + NSCertList() { } + public: + + /** Add an entry to the nick's certificate list + * + * @param entry The fingerprint to add to the cert list + * + * Adds a new entry into the cert list. + */ + virtual void AddCert(const Anope::string &entry) = 0; + + /** Get an entry from the nick's cert list by index + * + * @param entry Index in the certificaate list vector to retrieve + * @return The fingerprint entry of the given index if within bounds, an empty string if the vector is empty or the index is out of bounds + * + * Retrieves an entry from the certificate list corresponding to the given index. + */ + virtual Anope::string GetCert(unsigned entry) const = 0; + + virtual unsigned GetCertCount() const = 0; + + /** Find an entry in the nick's cert list + * + * @param entry The fingerprint to search for + * @return True if the fingerprint is found in the cert list, false otherwise + * + * Search for an fingerprint within the cert list. + */ + virtual bool FindCert(const Anope::string &entry) const = 0; + + /** Erase a fingerprint from the nick's certificate list + * + * @param entry The fingerprint to remove + * + * Removes the specified fingerprint from the cert list. + */ + virtual void EraseCert(const Anope::string &entry) = 0; + + /** Clears the entire nick's cert list + * + * Deletes all the memory allocated in the certificate list vector and then clears the vector. + */ + virtual void ClearCert() = 0; + + virtual void Check() = 0; +}; diff --git a/include/modules/ns_suspend.h b/include/modules/ns_suspend.h new file mode 100644 index 000000000..59f3d5d58 --- /dev/null +++ b/include/modules/ns_suspend.h @@ -0,0 +1,19 @@ +/* NickServ core functions + * + * (C) 2003-2013 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + */ + +struct NSSuspendInfo +{ + Anope::string nick, by, reason; + time_t when, expires; + + protected: + NSSuspendInfo() { } +}; |
