MSG_NOTICE = 1
};
-/** If you change the module API, change this value.
- * If you have enabled ipv6, the sizes of structs is
- * different, and modules will be incompatible with
- * ipv4 servers, so this value will be ten times as
- * high on ipv6 servers.
- */
-#define NATIVE_API_VERSION 12000
-#ifdef IPV6
-#define API_VERSION (NATIVE_API_VERSION * 10)
-#else
-#define API_VERSION (NATIVE_API_VERSION * 1)
-#endif
+/** If you change the module API, change this value. */
+#define API_VERSION 13000
class ServerConfig;
* @param text The actual modes and their parameters if any
* @param translate The translation types of the mode parameters
*/
- virtual void OnMode(User* user, void* dest, int target_type, const std::deque<std::string> &text, const std::deque<TranslateType> &translate);
+ virtual void OnMode(User* user, void* dest, int target_type, const std::vector<std::string> &text, const std::vector<TranslateType> &translate);
/** Allows modules to alter or create server descriptions
* Whenever a module requires a server description, for example for display in
* @param modeline The modes and parameters to be sent
* @param translate The translation types of the mode parameters
*/
- virtual void ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::deque<std::string> &modeline, const std::deque<TranslateType> &translate);
+ virtual void ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::vector<std::string> &modeline, const std::vector<TranslateType> &translate);
/** Implemented by modules which provide the ability to link servers.
* These modules will implement this method, which allows metadata (extra data added to
*/
virtual int OnDelBan(User* source, Channel* channel,const std::string &banmask);
- virtual void OnHookUserIO(User* user, const std::string &targetip);
+ virtual void OnHookUserIO(User* user);
/** Called immediately after any connection is accepted. This is intended for raw socket
* processing (e.g. modules which wrap the tcp connection within another library) and provides
* There are no return values from this call as all modules get an opportunity if required to
* process the connection.
* @param fd The file descriptor returned from accept()
- * @param ip The IP address of the connecting user
+ * @param client The client IP address and port
+ * @param server The server IP address and port
* @param localport The local port number the user connected to
*/
- virtual void OnRawSocketAccept(int fd, const std::string &ip, int localport);
+ virtual void OnRawSocketAccept(int fd, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server);
/** Called immediately before any write() operation on a user's socket in the core. Because
* this event is a low level event no user information is associated with it. It is intended
{
protected:
InspIRCd* ServerInstance;
- /** The contents of the configuration file
- * This protected member should never be accessed by a module (and cannot be accessed unless the
- * core is changed). It will contain a pointer to the configuration file data with unneeded data
- * (such as comments) stripped from it.
- */
- ConfigDataHash* data;
- /** Used to store errors
- */
- std::ostringstream* errorlog;
- /** If we're using our own config data hash or not
- */
- bool privatehash;
- /** True if an error occured reading the config file
- */
- bool readerror;
/** Error code
*/
long error;
* as specified when running ./configure.
*/
ConfigReader(InspIRCd* Instance);
- /** Overloaded constructor.
- * This constructor initialises the ConfigReader class to read a user-specified config file
- */
- ConfigReader(InspIRCd* Instance, const std::string &filename);
/** Default destructor.
* This method destroys the ConfigReader class.
*/
* multiple instance tag.
*/
int Enumerate(const std::string &tag);
- /** Returns true if a config file is valid.
- * This method is partially implemented and will only return false if the config
- * file does not exist or could not be opened.
- */
- bool Verify();
- /** Dumps the list of errors in a config file to an output location. If bail is true,
- * then the program will abort. If bail is false and user points to a valid user
- * record, the error report will be spooled to the given user by means of NOTICE.
- * if bool is false AND user is false, the error report will be spooled to all opers
- * by means of a NOTICE to all opers.
- */
- void DumpErrors(bool bail,User* user);
/** Returns the number of items within a tag.
* For example if the tag was <test tag="blah" data="foo"> then this
*/
std::map<std::string, std::pair<ircd_module*, Module*> > Modules;
+ enum {
+ PRIO_STATE_FIRST,
+ PRIO_STATE_AGAIN,
+ PRIO_STATE_LAST
+ } prioritizationState;
public:
/** Event handler hooks.
* @param i The event to change the priority of
* @param s The state you wish to use for this event. Use one of
* PRIO_FIRST to set the event to be first called, PRIO_LAST to
- * set it to be the last called, or PRIO_BEFORE and PRIO_AFTER
+ * set it to be the last called, or PRIO_BEFORE and PRIORITY_AFTER
* to set it to be before or after one or more other modules.
- * @param modules If PRIO_BEFORE or PRIO_AFTER is set in parameter 's',
+ * @param modules If PRIO_BEFORE or PRIORITY_AFTER is set in parameter 's',
* then this contains a list of one or more modules your module must be
* placed before or after. Your module will be placed before the highest
* priority module in this list for PRIO_BEFORE, or after the lowest
- * priority module in this list for PRIO_AFTER.
- * @param sz The number of modules being passed for PRIO_BEFORE and PRIO_AFTER.
+ * priority module in this list for PRIORITY_AFTER.
+ * @param sz The number of modules being passed for PRIO_BEFORE and PRIORITY_AFTER.
* Defaults to 1, as most of the time you will only want to prioritize your module
* to be before or after one other module.
*/
* @param mod The module to set the priority of
* @param s The priority of all events in the module.
* Note that with this method, it is not possible to effectively use
- * PRIO_BEFORE or PRIO_AFTER, you should use the more fine tuned
+ * PRIO_BEFORE or PRIORITY_AFTER, you should use the more fine tuned
* SetPriority method for this, where you may specify other modules to
* be prioritized against.
*/