+
+ /** Calls the handler for a command, either implemented by the core or by another module.
+ * You can use this function to trigger other commands in the ircd, such as PRIVMSG, JOIN,
+ * KICK etc, or even as a method of callback. By defining command names that are untypeable
+ * for users on irc (e.g. those which contain a \r or \n) you may use them as callback identifiers.
+ * The first parameter to this method is the name of the command handler you wish to call, e.g.
+ * PRIVMSG. This will be a command handler previously registered by the core or wih AddCommand().
+ * The second parameter is an array of parameters, and the third parameter is a count of parameters
+ * in the array. If you do not pass enough parameters to meet the minimum needed by the handler, the
+ * functiom will silently ignore it. The final parameter is the user executing the command handler,
+ * used for privilage checks, etc.
+ */
+ virtual void CallCommandHandler(std::string commandname, char** parameters, int pcnt, userrec* user);
+
+ /** Change displayed hostname of a user.
+ * You should always call this method to change a user's host rather than writing directly to the
+ * dhost member of userrec, as any change applied via this method will be propogated to any
+ * linked servers.
+ */
+ virtual void ChangeHost(userrec* user, std::string host);
+
+ /** Change GECOS (fullname) of a user.
+ * You should always call this method to change a user's GECOS rather than writing directly to the
+ * fullname member of userrec, as any change applied via this method will be propogated to any
+ * linked servers.
+ */
+ virtual void ChangeGECOS(userrec* user, std::string gecos);
+
+ /** Returns true if the servername you give is ulined.
+ * ULined servers have extra privilages. They are allowed to change nicknames on remote servers,
+ * change modes of clients which are on remote servers and set modes of channels where there are
+ * no channel operators for that channel on the ulined server, amongst other things. Ulined server
+ * data is also broadcast across the mesh at all times as opposed to selectively messaged in the
+ * case of normal servers, as many ulined server types (such as services) do not support meshed
+ * links and must operate in this manner.
+ */
+ virtual bool IsUlined(std::string server);
+
+ /** Fetches the userlist of a channel. This function must be here and not a member of userrec or
+ * chanrec due to include constraints.
+ */
+ virtual chanuserlist GetUsers(chanrec* chan);
+
+ /** Remove a user's connection to the irc server, but leave their client in existence in the
+ * user hash. When you call this function, the user's file descriptor will be replaced with the
+ * value of FD_MAGIC_NUMBER and their old file descriptor will be closed. This idle client will
+ * remain until it is restored with a valid file descriptor, or is removed from IRC by an operator
+ * After this call, the pointer to user will be invalid.
+ */
+ virtual bool UserToPseudo(userrec* user,std::string message);
+
+ /** This user takes one user, and switches their file descriptor with another user, so that one user
+ * "becomes" the other. The user in 'alive' is booted off the server with the given message. The user
+ * referred to by 'zombie' should have previously been locked with Server::ZombifyUser, otherwise
+ * stale sockets and file descriptor leaks can occur. After this call, the pointer to alive will be
+ * invalid, and the pointer to zombie will be equivalent in effect to the old pointer to alive.
+ */
+ virtual bool PseudoToUser(userrec* alive,userrec* zombie,std::string message);
+
+ /** Adds a G-line
+ * The G-line is propogated to all of the servers in the mesh and enforced as soon as it is added.
+ * The duration must be in seconds, however you can use the Server::CalcDuration method to convert
+ * durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used
+ * to indicate who or what sent the data, usually this is the nickname of a person, or a server
+ * name.
+ */
+ virtual void AddGLine(long duration, std::string source, std::string reason, std::string hostmask);
+
+ /** Adds a Q-line
+ * The Q-line is propogated to all of the servers in the mesh and enforced as soon as it is added.
+ * The duration must be in seconds, however you can use the Server::CalcDuration method to convert
+ * durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used
+ * to indicate who or what sent the data, usually this is the nickname of a person, or a server
+ * name.
+ */
+ virtual void AddQLine(long duration, std::string source, std::string reason, std::string nickname);
+
+ /** Adds a Z-line
+ * The Z-line is propogated to all of the servers in the mesh and enforced as soon as it is added.
+ * The duration must be in seconds, however you can use the Server::CalcDuration method to convert
+ * durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used
+ * to indicate who or what sent the data, usually this is the nickname of a person, or a server
+ * name.
+ */
+ virtual void AddZLine(long duration, std::string source, std::string reason, std::string ipaddr);
+
+ /** Adds a K-line
+ * The K-line is enforced as soon as it is added.
+ * The duration must be in seconds, however you can use the Server::CalcDuration method to convert
+ * durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used
+ * to indicate who or what sent the data, usually this is the nickname of a person, or a server
+ * name.
+ */
+ virtual void AddKLine(long duration, std::string source, std::string reason, std::string hostmask);
+
+ /** Adds a E-line
+ * The E-line is enforced as soon as it is added.
+ * The duration must be in seconds, however you can use the Server::CalcDuration method to convert
+ * durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used
+ * to indicate who or what sent the data, usually this is the nickname of a person, or a server
+ * name.
+ */
+ virtual void AddELine(long duration, std::string source, std::string reason, std::string hostmask);
+
+ /** Deletes a G-Line from all servers on the mesh
+ */
+ virtual bool DelGLine(std::string hostmask);
+
+ /** Deletes a Q-Line from all servers on the mesh
+ */
+ virtual bool DelQLine(std::string nickname);
+
+ /** Deletes a Z-Line from all servers on the mesh
+ */
+ virtual bool DelZLine(std::string ipaddr);
+
+ /** Deletes a local K-Line
+ */
+ virtual bool DelKLine(std::string hostmask);
+
+ /** Deletes a local E-Line
+ */
+ virtual bool DelELine(std::string hostmask);
+
+ /** Calculates a duration
+ * This method will take a string containing a formatted duration (e.g. "1w2d") and return its value
+ * as a total number of seconds. This is the same function used internally by /GLINE etc to set
+ * the ban times.
+ */
+ virtual long CalcDuration(std::string duration);
+
+ /** Returns true if a nick!ident@host string is correctly formatted, false if otherwise.
+ */
+ virtual bool IsValidMask(std::string mask);
+
+ /** Sends a line of text to all connected servers.
+ * If a server is not directly reachable, the core deals with routing the message, and will also
+ * deal with failures transparently.
+ */
+ virtual void MeshSendAll(std::string text);
+
+ /** This method sends a line of text to all servers who have users which share common channels with the user you provide.
+ * For example, if user A is on server A, and they are on channels #one and #two, and user B is on server B, and also on
+ * channel #one, but user C is on server C and on neither #one or #two, this function will cause the text to only be
+ * sent to server B. However, if server B is only reachable via C, it will route it to C (you do not have to worry about
+ * this routing, it is done transparently, but its good to know how things work!)
+ */
+ virtual void MeshSendCommon(userrec* user, std::string text);
+
+ /** This function is equivalent to Server::MeshSendToAll except it will only route to servers which are directly routable.
+ */
+ virtual void MeshSendAllAlive(std::string text);
+
+ /** This function sends a line of text directly to a server.
+ * If the server is not directly routable at this time, the server attempts to route text through the mesh.
+ */
+ virtual void MeshSendUnicast(std::string destination, std::string text);
+
+ /** This function sends to all servers EXCEPT the one you specify.
+ * You should usually use this function to send messages, specifying the SENDER of your message as 'target'.
+ * This will prevent message loops.
+ */
+ virtual void MeshSendAllExcept(std::string target, std::string text);
+
+ /** This function is used to check if any users on channel c are on server servername.
+ * This is used internally by PRIVMSG etc. You should not need to use it.
+ */
+ virtual bool MeshCheckChan(chanrec *c,std::string servername);
+
+ /** This function is used to check if user u has any channels in common with users on servername.
+ * This is used internally by Server::MeshSendCommon. You should very rarely need to use it.
+ */
+ virtual bool MeshCheckCommon(userrec* u,std::string servername);
+
+ /** This function finds a module by name.
+ * You must provide the filename of the module. If the module cannot be found (is not loaded)
+ * the function will return NULL.
+ */
+ virtual Module* FindModule(std::string name);