1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>InspIRCd: Server class Reference</title>
4 <link href="inspircd.css" rel="stylesheet" type="text/css">
6 <!-- Generated by Doxygen 1.3.3 -->
7 <div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Compound List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Compound Members</a> | <a class="qindex" href="globals.html">File Members</a></div>
8 <h1>Server Class Reference</h1>Allows server output and query functions This class contains methods which allow a module to query the state of the irc server, and produce output to users and other servers.
9 <a href="#_details">More...</a>
11 <code>#include <<a class="el" href="modules_8h-source.html">modules.h</a>></code>
13 Inherits <a class="el" href="classclassbase.html">classbase</a>.
15 <a href="classServer-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
17 <tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
18 <tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a0">Server</a> ()</td></tr>
20 <tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. </em> <a href="#a0"></a><em><br><br></td></tr>
21 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a1">~Server</a> ()</td></tr>
23 <tr><td class="mdescLeft"> </td><td class="mdescRight">Default destructor. </em> <a href="#a1"></a><em><br><br></td></tr>
24 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a2">SendOpers</a> (std::string s)</td></tr>
26 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends text to all opers. </em> <a href="#a2"></a><em><br><br></td></tr>
27 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a3">Log</a> (int level, std::string s)</td></tr>
29 <tr><td class="mdescLeft"> </td><td class="mdescRight">Writes a log string. </em> <a href="#a3"></a><em><br><br></td></tr>
30 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a4">Send</a> (int Socket, std::string s)</td></tr>
32 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends a line of text down a TCP/IP socket. </em> <a href="#a4"></a><em><br><br></td></tr>
33 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a5">SendServ</a> (int Socket, std::string s)</td></tr>
35 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends text from the server to a socket. </em> <a href="#a5"></a><em><br><br></td></tr>
36 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a6">SendChannelServerNotice</a> (std::string ServName, <a class="el" href="classchanrec.html">chanrec</a> *Channel, std::string text)</td></tr>
38 <tr><td class="mdescLeft"> </td><td class="mdescRight">Writes text to a channel, but from a server, including all. </em> <a href="#a6"></a><em><br><br></td></tr>
39 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a7">SendFrom</a> (int Socket, <a class="el" href="classuserrec.html">userrec</a> *User, std::string s)</td></tr>
41 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends text from a user to a socket. </em> <a href="#a7"></a><em><br><br></td></tr>
42 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a8">SendTo</a> (<a class="el" href="classuserrec.html">userrec</a> *Source, <a class="el" href="classuserrec.html">userrec</a> *Dest, std::string s)</td></tr>
44 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends text from a user to another user. </em> <a href="#a8"></a><em><br><br></td></tr>
45 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a9">SendChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *User, <a class="el" href="classchanrec.html">chanrec</a> *Channel, std::string s, bool IncludeSender)</td></tr>
47 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends text from a user to a channel (mulicast). </em> <a href="#a9"></a><em><br><br></td></tr>
48 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a10">CommonChannels</a> (<a class="el" href="classuserrec.html">userrec</a> *u1, <a class="el" href="classuserrec.html">userrec</a> *u2)</td></tr>
50 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns true if two users share a common channel. </em> <a href="#a10"></a><em><br><br></td></tr>
51 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a11">SendCommon</a> (<a class="el" href="classuserrec.html">userrec</a> *User, std::string text, bool IncludeSender)</td></tr>
53 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends text from a user to one or more channels (mulicast). </em> <a href="#a11"></a><em><br><br></td></tr>
54 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a12">SendWallops</a> (<a class="el" href="classuserrec.html">userrec</a> *User, std::string text)</td></tr>
56 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends a WALLOPS message. </em> <a href="#a12"></a><em><br><br></td></tr>
57 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a13">IsNick</a> (std::string nick)</td></tr>
59 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns true if a nick is valid. </em> <a href="#a13"></a><em><br><br></td></tr>
60 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual int </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a14">CountUsers</a> (<a class="el" href="classchanrec.html">chanrec</a> *c)</td></tr>
62 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a count of the number of users on a channel. </em> <a href="#a14"></a><em><br><br></td></tr>
63 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="classuserrec.html">userrec</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a15">FindNick</a> (std::string nick)</td></tr>
65 <tr><td class="mdescLeft"> </td><td class="mdescRight">Attempts to look up a nick and return a pointer to it. </em> <a href="#a15"></a><em><br><br></td></tr>
66 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="classuserrec.html">userrec</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a16">FindDescriptor</a> (int socket)</td></tr>
68 <tr><td class="mdescLeft"> </td><td class="mdescRight">Attempts to look up a nick using the file descriptor associated with that nick. </em> <a href="#a16"></a><em><br><br></td></tr>
69 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="classchanrec.html">chanrec</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a17">FindChannel</a> (std::string channel)</td></tr>
71 <tr><td class="mdescLeft"> </td><td class="mdescRight">Attempts to look up a channel and return a pointer to it. </em> <a href="#a17"></a><em><br><br></td></tr>
72 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual std::string </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a18">ChanMode</a> (<a class="el" href="classuserrec.html">userrec</a> *User, <a class="el" href="classchanrec.html">chanrec</a> *Chan)</td></tr>
74 <tr><td class="mdescLeft"> </td><td class="mdescRight">Attempts to look up a user's privilages on a channel. </em> <a href="#a18"></a><em><br><br></td></tr>
75 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a19">IsOnChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *User, <a class="el" href="classchanrec.html">chanrec</a> *Chan)</td></tr>
77 <tr><td class="mdescLeft"> </td><td class="mdescRight">Checks if a user is on a channel. </em> <a href="#a19"></a><em><br><br></td></tr>
78 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual std::string </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a20">GetServerName</a> ()</td></tr>
80 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the server name of the server where the module is loaded. </em> <a href="#a20"></a><em><br><br></td></tr>
81 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual std::string </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a21">GetNetworkName</a> ()</td></tr>
83 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the network name, global to all linked servers. </em> <a href="#a21"></a><em><br><br></td></tr>
84 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="classAdmin.html">Admin</a> </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a22">GetAdmin</a> ()</td></tr>
86 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the information of the server as returned by the /ADMIN command. </em> <a href="#a22"></a><em><br><br></td></tr>
87 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a23">AddExtendedMode</a> (char modechar, int type, bool requires_oper, int params_when_on, int params_when_off)</td></tr>
89 <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds an extended mode letter which is parsed by a module. </em> <a href="#a23"></a><em><br><br></td></tr>
90 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a24">AddExtendedListMode</a> (char modechar)</td></tr>
92 <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds an extended mode letter which is parsed by a module and handled in a list fashion. </em> <a href="#a24"></a><em><br><br></td></tr>
93 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a25">AddCommand</a> (char *cmd, handlerfunc f, char flags, int minparams, char *source)</td></tr>
95 <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a command to the command table. </em> <a href="#a25"></a><em><br><br></td></tr>
96 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a26">SendMode</a> (char **parameters, int pcnt, <a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
98 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends a servermode. </em> <a href="#a26"></a><em><br><br></td></tr>
99 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a27">SendToModeMask</a> (std::string modes, int flags, std::string text)</td></tr>
101 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends to all users matching a mode mask You must specify one or more usermodes as the first parameter. </em> <a href="#a27"></a><em><br><br></td></tr>
102 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="classchanrec.html">chanrec</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a28">JoinUserToChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string cname, std::string key)</td></tr>
104 <tr><td class="mdescLeft"> </td><td class="mdescRight">Forces a user to join a channel. </em> <a href="#a28"></a><em><br><br></td></tr>
105 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="classchanrec.html">chanrec</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a29">PartUserFromChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string cname, std::string reason)</td></tr>
107 <tr><td class="mdescLeft"> </td><td class="mdescRight">Forces a user to part a channel. </em> <a href="#a29"></a><em><br><br></td></tr>
108 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a30">ChangeUserNick</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string nickname)</td></tr>
110 <tr><td class="mdescLeft"> </td><td class="mdescRight">Forces a user nickchange. </em> <a href="#a30"></a><em><br><br></td></tr>
111 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a31">QuitUser</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string reason)</td></tr>
113 <tr><td class="mdescLeft"> </td><td class="mdescRight">Forces a user to quit with the specified reason. </em> <a href="#a31"></a><em><br><br></td></tr>
114 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a32">MatchText</a> (std::string sliteral, std::string spattern)</td></tr>
116 <tr><td class="mdescLeft"> </td><td class="mdescRight">Matches text against a glob pattern. </em> <a href="#a32"></a><em><br><br></td></tr>
117 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a33">CallCommandHandler</a> (std::string commandname, char **parameters, int pcnt, <a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
119 <tr><td class="mdescLeft"> </td><td class="mdescRight">Calls the handler for a command, either implemented by the core or by another module. </em> <a href="#a33"></a><em><br><br></td></tr>
120 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a34">ChangeHost</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string host)</td></tr>
122 <tr><td class="mdescLeft"> </td><td class="mdescRight">Change displayed hostname of a user. </em> <a href="#a34"></a><em><br><br></td></tr>
123 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a35">ChangeGECOS</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string gecos)</td></tr>
125 <tr><td class="mdescLeft"> </td><td class="mdescRight">Change GECOS (fullname) of a user. </em> <a href="#a35"></a><em><br><br></td></tr>
126 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a36">IsUlined</a> (std::string server)</td></tr>
128 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the servername you give is ulined. </em> <a href="#a36"></a><em><br><br></td></tr>
129 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="modules_8h.html#a33">chanuserlist</a> </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a37">GetUsers</a> (<a class="el" href="classchanrec.html">chanrec</a> *chan)</td></tr>
131 <tr><td class="mdescLeft"> </td><td class="mdescRight">Fetches the userlist of a channel. </em> <a href="#a37"></a><em><br><br></td></tr>
132 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a38">UserToPseudo</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string message)</td></tr>
134 <tr><td class="mdescLeft"> </td><td class="mdescRight">Remove a user's connection to the irc server, but leave their client in existence in the user hash. </em> <a href="#a38"></a><em><br><br></td></tr>
135 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a39">PseudoToUser</a> (<a class="el" href="classuserrec.html">userrec</a> *alive, <a class="el" href="classuserrec.html">userrec</a> *zombie, std::string message)</td></tr>
137 <tr><td class="mdescLeft"> </td><td class="mdescRight">This user takes one user, and switches their file descriptor with another user, so that one user "becomes" the other. </em> <a href="#a39"></a><em><br><br></td></tr>
138 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a40">AddGLine</a> (long duration, std::string source, std::string reason, std::string hostmask)</td></tr>
140 <tr><td class="mdescLeft"> </td><td class="mdescRight">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. </em> <a href="#a40"></a><em><br><br></td></tr>
141 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a41">AddQLine</a> (long duration, std::string source, std::string reason, std::string nickname)</td></tr>
143 <tr><td class="mdescLeft"> </td><td class="mdescRight">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. </em> <a href="#a41"></a><em><br><br></td></tr>
144 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a42">AddZLine</a> (long duration, std::string source, std::string reason, std::string ipaddr)</td></tr>
146 <tr><td class="mdescLeft"> </td><td class="mdescRight">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. </em> <a href="#a42"></a><em><br><br></td></tr>
147 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a43">AddKLine</a> (long duration, std::string source, std::string reason, std::string hostmask)</td></tr>
149 <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a K-line The K-line is enforced as soon as it is added. </em> <a href="#a43"></a><em><br><br></td></tr>
150 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a44">AddELine</a> (long duration, std::string source, std::string reason, std::string hostmask)</td></tr>
152 <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a E-line The E-line is enforced as soon as it is added. </em> <a href="#a44"></a><em><br><br></td></tr>
153 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a45">DelGLine</a> (std::string hostmask)</td></tr>
155 <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a G-Line from all servers on the mesh. </em> <a href="#a45"></a><em><br><br></td></tr>
156 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a46">DelQLine</a> (std::string nickname)</td></tr>
158 <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a Q-Line from all servers on the mesh. </em> <a href="#a46"></a><em><br><br></td></tr>
159 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a47">DelZLine</a> (std::string ipaddr)</td></tr>
161 <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a Z-Line from all servers on the mesh. </em> <a href="#a47"></a><em><br><br></td></tr>
162 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a48">DelKLine</a> (std::string hostmask)</td></tr>
164 <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a local K-Line. </em> <a href="#a48"></a><em><br><br></td></tr>
165 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a49">DelELine</a> (std::string hostmask)</td></tr>
167 <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a local E-Line. </em> <a href="#a49"></a><em><br><br></td></tr>
168 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual long </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a50">CalcDuration</a> (std::string duration)</td></tr>
170 <tr><td class="mdescLeft"> </td><td class="mdescRight">Calculates a duration This method will take a string containing a formatted duration (e.g. </em> <a href="#a50"></a><em><br><br></td></tr>
171 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a51">IsValidMask</a> (std::string mask)</td></tr>
173 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns true if a nick!ident string is correctly formatted, false if otherwise. </em> <a href="#a51"></a><em><br><br></td></tr>
174 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a52">MeshSendAll</a> (std::string text)</td></tr>
176 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends a line of text to all connected servers. </em> <a href="#a52"></a><em><br><br></td></tr>
177 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a53">MeshSendCommon</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string text)</td></tr>
179 <tr><td class="mdescLeft"> </td><td class="mdescRight">This method sends a line of text to all servers who have users which share common channels with the user you provide. </em> <a href="#a53"></a><em><br><br></td></tr>
180 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a54">MeshSendAllAlive</a> (std::string text)</td></tr>
182 <tr><td class="mdescLeft"> </td><td class="mdescRight">This function is equivalent to Server::MeshSendToAll except it will only route to servers which are directly routable. </em> <a href="#a54"></a><em><br><br></td></tr>
183 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a55">MeshSendUnicast</a> (std::string destination, std::string text)</td></tr>
185 <tr><td class="mdescLeft"> </td><td class="mdescRight">This function sends a line of text directly to a server. </em> <a href="#a55"></a><em><br><br></td></tr>
186 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a56">MeshSendAllExcept</a> (std::string target, std::string text)</td></tr>
188 <tr><td class="mdescLeft"> </td><td class="mdescRight">This function sends to all servers EXCEPT the one you specify. </em> <a href="#a56"></a><em><br><br></td></tr>
189 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a57">MeshCheckChan</a> (<a class="el" href="classchanrec.html">chanrec</a> *c, std::string servername)</td></tr>
191 <tr><td class="mdescLeft"> </td><td class="mdescRight">This function is used to check if any users on channel c are on server servername. </em> <a href="#a57"></a><em><br><br></td></tr>
192 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a58">MeshCheckCommon</a> (<a class="el" href="classuserrec.html">userrec</a> *u, std::string servername)</td></tr>
194 <tr><td class="mdescLeft"> </td><td class="mdescRight">This function is used to check if user u has any channels in common with users on servername. </em> <a href="#a58"></a><em><br><br></td></tr>
195 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="classModule.html">Module</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a59">FindModule</a> (std::string name)</td></tr>
197 <tr><td class="mdescLeft"> </td><td class="mdescRight">This function finds a module by name. </em> <a href="#a59"></a><em><br><br></td></tr>
199 <hr><a name="_details"></a><h2>Detailed Description</h2>
200 Allows server output and query functions This class contains methods which allow a module to query the state of the irc server, and produce output to users and other servers.
202 All modules should instantiate at least one copy of this class, and use its member functions to perform their tasks.
206 Definition at line <a class="el" href="modules_8h-source.html#l00694">694</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor & Destructor Documentation</h2>
207 <a name="a0" doxytag="Server::Server"></a><p>
208 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
211 <table cellpadding="0" cellspacing="0" border="0">
213 <td class="md" nowrap valign="top"> Server::Server </td>
214 <td class="md" valign="top">( </td>
215 <td class="mdname1" valign="top" nowrap> </td>
216 <td class="md" valign="top"> ) </td>
217 <td class="md" nowrap></td>
224 <table cellspacing=5 cellpadding=0 border=0>
234 Creates a Server object.
236 Definition at line <a class="el" href="modules_8cpp-source.html#l00431">431</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
238 <div class="fragment"><pre>00432 {
243 <a name="a1" doxytag="Server::~Server"></a><p>
244 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
247 <table cellpadding="0" cellspacing="0" border="0">
249 <td class="md" nowrap valign="top"> Server::~<a class="el" href="classServer.html">Server</a> </td>
250 <td class="md" valign="top">( </td>
251 <td class="mdname1" valign="top" nowrap> </td>
252 <td class="md" valign="top"> ) </td>
253 <td class="md" nowrap><code> [virtual]</code></td>
260 <table cellspacing=5 cellpadding=0 border=0>
270 Destroys a Server object.
272 Definition at line <a class="el" href="modules_8cpp-source.html#l00435">435</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
274 <div class="fragment"><pre>00436 {
279 <hr><h2>Member Function Documentation</h2>
280 <a name="a25" doxytag="Server::AddCommand"></a><p>
281 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
284 <table cellpadding="0" cellspacing="0" border="0">
286 <td class="md" nowrap valign="top"> void Server::AddCommand </td>
287 <td class="md" valign="top">( </td>
288 <td class="md" nowrap valign="top">char * </td>
289 <td class="mdname" nowrap> <em>cmd</em>, </td>
294 <td class="md" nowrap>handlerfunc </td>
295 <td class="mdname" nowrap> <em>f</em>, </td>
300 <td class="md" nowrap>char </td>
301 <td class="mdname" nowrap> <em>flags</em>, </td>
306 <td class="md" nowrap>int </td>
307 <td class="mdname" nowrap> <em>minparams</em>, </td>
312 <td class="md" nowrap>char * </td>
313 <td class="mdname" nowrap> <em>source</em></td>
317 <td class="md">) </td>
318 <td class="md" colspan="2"><code> [virtual]</code></td>
325 <table cellspacing=5 cellpadding=0 border=0>
333 Adds a command to the command table.
335 This allows modules to add extra commands into the command table. You must place a function within your module which is is of type handlerfunc:<p>
336 typedef void (handlerfunc) (char**, int, userrec*); ... void <a class="el" href="commands_8h.html#a5">handle_kill(char **parameters, int pcnt, userrec *user)</a><p>
337 When the command is typed, the parameters will be placed into the parameters array (similar to argv) and the parameter count will be placed into pcnt (similar to argv). There will never be any less parameters than the 'minparams' value you specified when creating the command. The *user parameter is the class of the user which caused the command to trigger, who will always have the flag you specified in 'flags' when creating the initial command. For example to create an oper only command create the commands with flags='o'. The source parameter is used for resource tracking, and should contain the name of your module (with file extension) e.g. "m_blarp.so". If you place the wrong identifier here, you can cause crashes if your module is unloaded.
339 Definition at line <a class="el" href="modules_8cpp-source.html#l00504">504</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
341 References <a class="el" href="modules_8h.html#a35">createcommand()</a>.
343 <div class="fragment"><pre>00505 {
344 00506 <a class="code" href="modules_8h.html#a35">createcommand</a>(cmd,f,flags,minparams,source);
349 <a name="a44" doxytag="Server::AddELine"></a><p>
350 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
353 <table cellpadding="0" cellspacing="0" border="0">
355 <td class="md" nowrap valign="top"> void Server::AddELine </td>
356 <td class="md" valign="top">( </td>
357 <td class="md" nowrap valign="top">long </td>
358 <td class="mdname" nowrap> <em>duration</em>, </td>
363 <td class="md" nowrap>std::string </td>
364 <td class="mdname" nowrap> <em>source</em>, </td>
369 <td class="md" nowrap>std::string </td>
370 <td class="mdname" nowrap> <em>reason</em>, </td>
375 <td class="md" nowrap>std::string </td>
376 <td class="mdname" nowrap> <em>hostmask</em></td>
380 <td class="md">) </td>
381 <td class="md" colspan="2"><code> [virtual]</code></td>
388 <table cellspacing=5 cellpadding=0 border=0>
396 Adds a E-line The E-line is enforced as soon as it is added.
398 The duration must be in seconds, however you can use the <a class="el" href="classServer.html#a50">Server::CalcDuration</a> 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.
400 Definition at line <a class="el" href="modules_8cpp-source.html#l00750">750</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
402 References <a class="el" href="xline_8h.html#a5">add_eline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
404 <div class="fragment"><pre>00751 {
405 00752 <a class="code" href="xline_8h.html#a5">add_eline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
410 <a name="a24" doxytag="Server::AddExtendedListMode"></a><p>
411 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
414 <table cellpadding="0" cellspacing="0" border="0">
416 <td class="md" nowrap valign="top"> bool Server::AddExtendedListMode </td>
417 <td class="md" valign="top">( </td>
418 <td class="md" nowrap valign="top">char </td>
419 <td class="mdname1" valign="top" nowrap> <em>modechar</em> </td>
420 <td class="md" valign="top"> ) </td>
421 <td class="md" nowrap><code> [virtual]</code></td>
428 <table cellspacing=5 cellpadding=0 border=0>
436 Adds an extended mode letter which is parsed by a module and handled in a list fashion.
438 This call is used to implement modes like +q and +a. The characteristics of these modes are as follows:<p>
439 (1) They are ALWAYS on channels, not on users, therefore their type is MT_CHANNEL<p>
440 (2) They always take exactly one parameter when being added or removed<p>
441 (3) They can be set multiple times, usually on users in channels<p>
442 (4) The mode and its parameter are NOT stored in the channels modes structure<p>
443 It is down to the module handling the mode to maintain state and determine what 'items' (e.g. users, or a banlist) have the mode set on them, and process the modes at the correct times, e.g. during access checks on channels, etc. When the extended mode is triggered the OnExtendedMode method will be triggered as above. Note that the target you are given will be a channel, if for example your mode is set 'on a user' (in for example +a) you must use Server::Find to locate the user the mode is operating on. Your mode handler may return 1 to handle the mode AND tell the core to display the mode change, e.g. '+aaa one two three' in the case of the mode for 'two', or it may return -1 to 'eat' the mode change, so the above example would become '+aa one three' after processing.
445 Definition at line <a class="el" href="modules_8cpp-source.html#l00667">667</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
447 References <a class="el" href="modules_8cpp-source.html#l00285">DoAddExtendedMode()</a>, <a class="el" href="modules_8cpp-source.html#l00295">ModeMakeList()</a>, and <a class="el" href="modules_8h-source.html#l00031">MT_CHANNEL</a>.
449 <div class="fragment"><pre>00668 {
450 00669 <span class="keywordtype">bool</span> res = <a class="code" href="modules_8cpp.html#a59">DoAddExtendedMode</a>(modechar,MT_CHANNEL,<span class="keyword">false</span>,1,1);
451 00670 <span class="keywordflow">if</span> (res)
452 00671 <a class="code" href="modules_8cpp.html#a60">ModeMakeList</a>(modechar);
453 00672 <span class="keywordflow">return</span> res;
458 <a name="a23" doxytag="Server::AddExtendedMode"></a><p>
459 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
462 <table cellpadding="0" cellspacing="0" border="0">
464 <td class="md" nowrap valign="top"> bool Server::AddExtendedMode </td>
465 <td class="md" valign="top">( </td>
466 <td class="md" nowrap valign="top">char </td>
467 <td class="mdname" nowrap> <em>modechar</em>, </td>
472 <td class="md" nowrap>int </td>
473 <td class="mdname" nowrap> <em>type</em>, </td>
478 <td class="md" nowrap>bool </td>
479 <td class="mdname" nowrap> <em>requires_oper</em>, </td>
484 <td class="md" nowrap>int </td>
485 <td class="mdname" nowrap> <em>params_when_on</em>, </td>
490 <td class="md" nowrap>int </td>
491 <td class="mdname" nowrap> <em>params_when_off</em></td>
495 <td class="md">) </td>
496 <td class="md" colspan="2"><code> [virtual]</code></td>
503 <table cellspacing=5 cellpadding=0 border=0>
511 Adds an extended mode letter which is parsed by a module.
513 This allows modules to add extra mode letters, e.g. +x for hostcloak. the "type" parameter is either MT_CHANNEL, MT_CLIENT, or MT_SERVER, to indicate wether the mode is a channel mode, a client mode, or a server mode. requires_oper is used with MT_CLIENT type modes only to indicate the mode can only be set or unset by an oper. If this is used for MT_CHANNEL type modes it is ignored. params_when_on is the number of modes to expect when the mode is turned on (for type MT_CHANNEL only), e.g. with mode +k, this would have a value of 1. the params_when_off value has a similar value to params_when_on, except it indicates the number of parameters to expect when the mode is disabled. Modes which act in a similar way to channel mode +l (e.g. require a parameter to enable, but not to disable) should use this parameter. The function returns false if the mode is unavailable, and will not attempt to allocate another character, as this will confuse users. This also means that as only one module can claim a specific mode character, the core does not need to keep track of which modules own which modes, which speeds up operation of the server. In this version, a mode can have at most one parameter, attempting to use more parameters will have undefined effects.
515 Definition at line <a class="el" href="modules_8cpp-source.html#l00639">639</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
517 References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, <a class="el" href="modules_8cpp-source.html#l00285">DoAddExtendedMode()</a>, <a class="el" href="modules_8h-source.html#l00032">MT_CLIENT</a>, and <a class="el" href="modules_8h-source.html#l00033">MT_SERVER</a>.
519 <div class="fragment"><pre>00640 {
520 00641 <span class="keywordflow">if</span> (((modechar >= <span class="charliteral">'A'</span>) && (modechar <= 'Z')) || ((modechar >= <span class="charliteral">'a'</span>) && (modechar <= <span class="charliteral">'z'</span>)))
522 00643 <span class="keywordflow">if</span> (type == <a class="code" href="modules_8h.html#a7">MT_SERVER</a>)
524 00645 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion"</span>);
525 00646 <span class="keywordflow">return</span> <span class="keyword">false</span>;
527 00648 <span class="keywordflow">if</span> (((params_when_on>0) || (params_when_off>0)) && (type == <a class="code" href="modules_8h.html#a6">MT_CLIENT</a>))
529 00650 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Parameters on MT_CLIENT modes are not supported"</span>);
530 00651 <span class="keywordflow">return</span> <span class="keyword">false</span>;
532 00653 <span class="keywordflow">if</span> ((params_when_on>1) || (params_when_off>1))
534 00655 log(DEBUG,<span class="stringliteral">"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported"</span>);
535 00656 <span class="keywordflow">return</span> <span class="keyword">false</span>;
537 00658 <span class="keywordflow">return</span> <a class="code" href="modules_8cpp.html#a59">DoAddExtendedMode</a>(modechar,type,requires_oper,params_when_on,params_when_off);
539 00660 <span class="keywordflow">else</span>
541 00662 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Muppet modechar detected."</span>);
543 00664 <span class="keywordflow">return</span> <span class="keyword">false</span>;
548 <a name="a40" doxytag="Server::AddGLine"></a><p>
549 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
552 <table cellpadding="0" cellspacing="0" border="0">
554 <td class="md" nowrap valign="top"> void Server::AddGLine </td>
555 <td class="md" valign="top">( </td>
556 <td class="md" nowrap valign="top">long </td>
557 <td class="mdname" nowrap> <em>duration</em>, </td>
562 <td class="md" nowrap>std::string </td>
563 <td class="mdname" nowrap> <em>source</em>, </td>
568 <td class="md" nowrap>std::string </td>
569 <td class="mdname" nowrap> <em>reason</em>, </td>
574 <td class="md" nowrap>std::string </td>
575 <td class="mdname" nowrap> <em>hostmask</em></td>
579 <td class="md">) </td>
580 <td class="md" colspan="2"><code> [virtual]</code></td>
587 <table cellspacing=5 cellpadding=0 border=0>
595 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.
597 The duration must be in seconds, however you can use the <a class="el" href="classServer.html#a50">Server::CalcDuration</a> 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.
599 Definition at line <a class="el" href="modules_8cpp-source.html#l00730">730</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
601 References <a class="el" href="xline_8h.html#a1">add_gline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
603 <div class="fragment"><pre>00731 {
604 00732 <a class="code" href="xline_8h.html#a1">add_gline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
609 <a name="a43" doxytag="Server::AddKLine"></a><p>
610 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
613 <table cellpadding="0" cellspacing="0" border="0">
615 <td class="md" nowrap valign="top"> void Server::AddKLine </td>
616 <td class="md" valign="top">( </td>
617 <td class="md" nowrap valign="top">long </td>
618 <td class="mdname" nowrap> <em>duration</em>, </td>
623 <td class="md" nowrap>std::string </td>
624 <td class="mdname" nowrap> <em>source</em>, </td>
629 <td class="md" nowrap>std::string </td>
630 <td class="mdname" nowrap> <em>reason</em>, </td>
635 <td class="md" nowrap>std::string </td>
636 <td class="mdname" nowrap> <em>hostmask</em></td>
640 <td class="md">) </td>
641 <td class="md" colspan="2"><code> [virtual]</code></td>
648 <table cellspacing=5 cellpadding=0 border=0>
656 Adds a K-line The K-line is enforced as soon as it is added.
658 The duration must be in seconds, however you can use the <a class="el" href="classServer.html#a50">Server::CalcDuration</a> 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.
660 Definition at line <a class="el" href="modules_8cpp-source.html#l00745">745</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
662 References <a class="el" href="xline_8h.html#a4">add_kline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
664 <div class="fragment"><pre>00746 {
665 00747 <a class="code" href="xline_8h.html#a4">add_kline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
670 <a name="a41" doxytag="Server::AddQLine"></a><p>
671 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
674 <table cellpadding="0" cellspacing="0" border="0">
676 <td class="md" nowrap valign="top"> void Server::AddQLine </td>
677 <td class="md" valign="top">( </td>
678 <td class="md" nowrap valign="top">long </td>
679 <td class="mdname" nowrap> <em>duration</em>, </td>
684 <td class="md" nowrap>std::string </td>
685 <td class="mdname" nowrap> <em>source</em>, </td>
690 <td class="md" nowrap>std::string </td>
691 <td class="mdname" nowrap> <em>reason</em>, </td>
696 <td class="md" nowrap>std::string </td>
697 <td class="mdname" nowrap> <em>nickname</em></td>
701 <td class="md">) </td>
702 <td class="md" colspan="2"><code> [virtual]</code></td>
709 <table cellspacing=5 cellpadding=0 border=0>
717 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.
719 The duration must be in seconds, however you can use the <a class="el" href="classServer.html#a50">Server::CalcDuration</a> 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.
721 Definition at line <a class="el" href="modules_8cpp-source.html#l00735">735</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
723 References <a class="el" href="xline_8h.html#a2">add_qline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
725 <div class="fragment"><pre>00736 {
726 00737 <a class="code" href="xline_8h.html#a2">add_qline</a>(duration, source.c_str(), reason.c_str(), nickname.c_str());
731 <a name="a42" doxytag="Server::AddZLine"></a><p>
732 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
735 <table cellpadding="0" cellspacing="0" border="0">
737 <td class="md" nowrap valign="top"> void Server::AddZLine </td>
738 <td class="md" valign="top">( </td>
739 <td class="md" nowrap valign="top">long </td>
740 <td class="mdname" nowrap> <em>duration</em>, </td>
745 <td class="md" nowrap>std::string </td>
746 <td class="mdname" nowrap> <em>source</em>, </td>
751 <td class="md" nowrap>std::string </td>
752 <td class="mdname" nowrap> <em>reason</em>, </td>
757 <td class="md" nowrap>std::string </td>
758 <td class="mdname" nowrap> <em>ipaddr</em></td>
762 <td class="md">) </td>
763 <td class="md" colspan="2"><code> [virtual]</code></td>
770 <table cellspacing=5 cellpadding=0 border=0>
778 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.
780 The duration must be in seconds, however you can use the <a class="el" href="classServer.html#a50">Server::CalcDuration</a> 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.
782 Definition at line <a class="el" href="modules_8cpp-source.html#l00740">740</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
784 References <a class="el" href="xline_8h.html#a3">add_zline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
786 <div class="fragment"><pre>00741 {
787 00742 <a class="code" href="xline_8h.html#a3">add_zline</a>(duration, source.c_str(), reason.c_str(), ipaddr.c_str());
792 <a name="a50" doxytag="Server::CalcDuration"></a><p>
793 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
796 <table cellpadding="0" cellspacing="0" border="0">
798 <td class="md" nowrap valign="top"> long Server::CalcDuration </td>
799 <td class="md" valign="top">( </td>
800 <td class="md" nowrap valign="top">std::string </td>
801 <td class="mdname1" valign="top" nowrap> <em>duration</em> </td>
802 <td class="md" valign="top"> ) </td>
803 <td class="md" nowrap><code> [virtual]</code></td>
810 <table cellspacing=5 cellpadding=0 border=0>
818 Calculates a duration This method will take a string containing a formatted duration (e.g.
820 "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.
822 Definition at line <a class="el" href="modules_8cpp-source.html#l00780">780</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
824 References <a class="el" href="commands_8h.html#a75">duration()</a>.
826 <div class="fragment"><pre>00781 {
827 00782 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a75">duration</a>(delta.c_str());
832 <a name="a33" doxytag="Server::CallCommandHandler"></a><p>
833 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
836 <table cellpadding="0" cellspacing="0" border="0">
838 <td class="md" nowrap valign="top"> void Server::CallCommandHandler </td>
839 <td class="md" valign="top">( </td>
840 <td class="md" nowrap valign="top">std::string </td>
841 <td class="mdname" nowrap> <em>commandname</em>, </td>
846 <td class="md" nowrap>char ** </td>
847 <td class="mdname" nowrap> <em>parameters</em>, </td>
852 <td class="md" nowrap>int </td>
853 <td class="mdname" nowrap> <em>pcnt</em>, </td>
858 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
859 <td class="mdname" nowrap> <em>user</em></td>
863 <td class="md">) </td>
864 <td class="md" colspan="2"><code> [virtual]</code></td>
871 <table cellspacing=5 cellpadding=0 border=0>
879 Calls the handler for a command, either implemented by the core or by another module.
881 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 or <br>
882 ) 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 <a class="el" href="classServer.html#a25">AddCommand()</a>. 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.
884 Definition at line <a class="el" href="modules_8cpp-source.html#l00494">494</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
886 <div class="fragment"><pre>00495 {
887 00496 call_handler(commandname.c_str(),parameters,pcnt,user);
892 <a name="a35" doxytag="Server::ChangeGECOS"></a><p>
893 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
896 <table cellpadding="0" cellspacing="0" border="0">
898 <td class="md" nowrap valign="top"> void Server::ChangeGECOS </td>
899 <td class="md" valign="top">( </td>
900 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
901 <td class="mdname" nowrap> <em>user</em>, </td>
906 <td class="md" nowrap>std::string </td>
907 <td class="mdname" nowrap> <em>gecos</em></td>
911 <td class="md">) </td>
912 <td class="md" colspan="2"><code> [virtual]</code></td>
919 <table cellspacing=5 cellpadding=0 border=0>
927 Change GECOS (fullname) of a user.
929 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.
931 Definition at line <a class="el" href="modules_8cpp-source.html#l00587">587</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
933 References <a class="el" href="message_8h.html#a10">ChangeName()</a>.
935 <div class="fragment"><pre>00588 {
936 00589 <a class="code" href="message_8h.html#a10">ChangeName</a>(user,gecos.c_str());
941 <a name="a34" doxytag="Server::ChangeHost"></a><p>
942 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
945 <table cellpadding="0" cellspacing="0" border="0">
947 <td class="md" nowrap valign="top"> void Server::ChangeHost </td>
948 <td class="md" valign="top">( </td>
949 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
950 <td class="mdname" nowrap> <em>user</em>, </td>
955 <td class="md" nowrap>std::string </td>
956 <td class="mdname" nowrap> <em>host</em></td>
960 <td class="md">) </td>
961 <td class="md" colspan="2"><code> [virtual]</code></td>
968 <table cellspacing=5 cellpadding=0 border=0>
976 Change displayed hostname of a user.
978 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.
980 Definition at line <a class="el" href="modules_8cpp-source.html#l00582">582</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
982 References <a class="el" href="message_8h.html#a11">ChangeDisplayedHost()</a>.
984 <div class="fragment"><pre>00583 {
985 00584 <a class="code" href="message_8h.html#a11">ChangeDisplayedHost</a>(user,host.c_str());
990 <a name="a30" doxytag="Server::ChangeUserNick"></a><p>
991 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
994 <table cellpadding="0" cellspacing="0" border="0">
996 <td class="md" nowrap valign="top"> void Server::ChangeUserNick </td>
997 <td class="md" valign="top">( </td>
998 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
999 <td class="mdname" nowrap> <em>user</em>, </td>
1004 <td class="md" nowrap>std::string </td>
1005 <td class="mdname" nowrap> <em>nickname</em></td>
1009 <td class="md">) </td>
1010 <td class="md" colspan="2"><code> [virtual]</code></td>
1017 <table cellspacing=5 cellpadding=0 border=0>
1025 Forces a user nickchange.
1027 This command works similarly to SVSNICK, and can be used to implement Q-lines etc. If you specify an invalid nickname, the nick change will be dropped and the target user will receive the error numeric for it.
1029 Definition at line <a class="el" href="modules_8cpp-source.html#l00479">479</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1031 <div class="fragment"><pre>00480 {
1032 00481 force_nickchange(user,nickname.c_str());
1037 <a name="a18" doxytag="Server::ChanMode"></a><p>
1038 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1041 <table cellpadding="0" cellspacing="0" border="0">
1043 <td class="md" nowrap valign="top"> std::string Server::ChanMode </td>
1044 <td class="md" valign="top">( </td>
1045 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1046 <td class="mdname" nowrap> <em>User</em>, </td>
1051 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
1052 <td class="mdname" nowrap> <em>Chan</em></td>
1056 <td class="md">) </td>
1057 <td class="md" colspan="2"><code> [virtual]</code></td>
1064 <table cellspacing=5 cellpadding=0 border=0>
1072 Attempts to look up a user's privilages on a channel.
1074 This function will return a string containing either @, , +, or an empty string, representing the user's privilages upon the channel you specify.
1076 Definition at line <a class="el" href="modules_8cpp-source.html#l00612">612</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1078 References <a class="el" href="message_8h.html#a14">cmode()</a>.
1080 <div class="fragment"><pre>00613 {
1081 00614 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a14">cmode</a>(User,Chan);
1086 <a name="a10" doxytag="Server::CommonChannels"></a><p>
1087 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1090 <table cellpadding="0" cellspacing="0" border="0">
1092 <td class="md" nowrap valign="top"> bool Server::CommonChannels </td>
1093 <td class="md" valign="top">( </td>
1094 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1095 <td class="mdname" nowrap> <em>u1</em>, </td>
1100 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
1101 <td class="mdname" nowrap> <em>u2</em></td>
1105 <td class="md">) </td>
1106 <td class="md" colspan="2"><code> [virtual]</code></td>
1113 <table cellspacing=5 cellpadding=0 border=0>
1121 Returns true if two users share a common channel.
1123 This method is used internally by the NICK and QUIT commands, and the <a class="el" href="classServer.html#a11">Server::SendCommon</a> method.
1125 Definition at line <a class="el" href="modules_8cpp-source.html#l00560">560</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1127 References <a class="el" href="message_8h.html#a0">common_channels()</a>.
1129 <div class="fragment"><pre>00561 {
1130 00562 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a0">common_channels</a>(u1,u2) != 0);
1135 <a name="a14" doxytag="Server::CountUsers"></a><p>
1136 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1139 <table cellpadding="0" cellspacing="0" border="0">
1141 <td class="md" nowrap valign="top"> int Server::CountUsers </td>
1142 <td class="md" valign="top">( </td>
1143 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
1144 <td class="mdname1" valign="top" nowrap> <em>c</em> </td>
1145 <td class="md" valign="top"> ) </td>
1146 <td class="md" nowrap><code> [virtual]</code></td>
1153 <table cellspacing=5 cellpadding=0 border=0>
1161 Returns a count of the number of users on a channel.
1163 This will NEVER be 0, as if the chanrec exists, it will have at least one user in the channel.
1165 Definition at line <a class="el" href="modules_8cpp-source.html#l00675">675</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1167 <div class="fragment"><pre>00676 {
1168 00677 <span class="keywordflow">return</span> usercount(c);
1173 <a name="a49" doxytag="Server::DelELine"></a><p>
1174 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1177 <table cellpadding="0" cellspacing="0" border="0">
1179 <td class="md" nowrap valign="top"> bool Server::DelELine </td>
1180 <td class="md" valign="top">( </td>
1181 <td class="md" nowrap valign="top">std::string </td>
1182 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1183 <td class="md" valign="top"> ) </td>
1184 <td class="md" nowrap><code> [virtual]</code></td>
1191 <table cellspacing=5 cellpadding=0 border=0>
1199 Deletes a local E-Line.
1203 Definition at line <a class="el" href="modules_8cpp-source.html#l00775">775</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1205 References <a class="el" href="xline_8h.html#a10">del_eline()</a>.
1207 <div class="fragment"><pre>00776 {
1208 00777 <a class="code" href="xline_8h.html#a10">del_eline</a>(hostmask.c_str());
1213 <a name="a45" doxytag="Server::DelGLine"></a><p>
1214 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1217 <table cellpadding="0" cellspacing="0" border="0">
1219 <td class="md" nowrap valign="top"> bool Server::DelGLine </td>
1220 <td class="md" valign="top">( </td>
1221 <td class="md" nowrap valign="top">std::string </td>
1222 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1223 <td class="md" valign="top"> ) </td>
1224 <td class="md" nowrap><code> [virtual]</code></td>
1231 <table cellspacing=5 cellpadding=0 border=0>
1239 Deletes a G-Line from all servers on the mesh.
1243 Definition at line <a class="el" href="modules_8cpp-source.html#l00755">755</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1245 References <a class="el" href="xline_8h.html#a6">del_gline()</a>.
1247 <div class="fragment"><pre>00756 {
1248 00757 <a class="code" href="xline_8h.html#a6">del_gline</a>(hostmask.c_str());
1253 <a name="a48" doxytag="Server::DelKLine"></a><p>
1254 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1257 <table cellpadding="0" cellspacing="0" border="0">
1259 <td class="md" nowrap valign="top"> bool Server::DelKLine </td>
1260 <td class="md" valign="top">( </td>
1261 <td class="md" nowrap valign="top">std::string </td>
1262 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1263 <td class="md" valign="top"> ) </td>
1264 <td class="md" nowrap><code> [virtual]</code></td>
1271 <table cellspacing=5 cellpadding=0 border=0>
1279 Deletes a local K-Line.
1283 Definition at line <a class="el" href="modules_8cpp-source.html#l00770">770</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1285 References <a class="el" href="xline_8h.html#a9">del_kline()</a>.
1287 <div class="fragment"><pre>00771 {
1288 00772 <a class="code" href="xline_8h.html#a9">del_kline</a>(hostmask.c_str());
1293 <a name="a46" doxytag="Server::DelQLine"></a><p>
1294 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1297 <table cellpadding="0" cellspacing="0" border="0">
1299 <td class="md" nowrap valign="top"> bool Server::DelQLine </td>
1300 <td class="md" valign="top">( </td>
1301 <td class="md" nowrap valign="top">std::string </td>
1302 <td class="mdname1" valign="top" nowrap> <em>nickname</em> </td>
1303 <td class="md" valign="top"> ) </td>
1304 <td class="md" nowrap><code> [virtual]</code></td>
1311 <table cellspacing=5 cellpadding=0 border=0>
1319 Deletes a Q-Line from all servers on the mesh.
1323 Definition at line <a class="el" href="modules_8cpp-source.html#l00760">760</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1325 References <a class="el" href="xline_8h.html#a7">del_qline()</a>.
1327 <div class="fragment"><pre>00761 {
1328 00762 <a class="code" href="xline_8h.html#a7">del_qline</a>(nickname.c_str());
1333 <a name="a47" doxytag="Server::DelZLine"></a><p>
1334 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1337 <table cellpadding="0" cellspacing="0" border="0">
1339 <td class="md" nowrap valign="top"> bool Server::DelZLine </td>
1340 <td class="md" valign="top">( </td>
1341 <td class="md" nowrap valign="top">std::string </td>
1342 <td class="mdname1" valign="top" nowrap> <em>ipaddr</em> </td>
1343 <td class="md" valign="top"> ) </td>
1344 <td class="md" nowrap><code> [virtual]</code></td>
1351 <table cellspacing=5 cellpadding=0 border=0>
1359 Deletes a Z-Line from all servers on the mesh.
1363 Definition at line <a class="el" href="modules_8cpp-source.html#l00765">765</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1365 References <a class="el" href="xline_8h.html#a8">del_zline()</a>.
1367 <div class="fragment"><pre>00766 {
1368 00767 <a class="code" href="xline_8h.html#a8">del_zline</a>(ipaddr.c_str());
1373 <a name="a17" doxytag="Server::FindChannel"></a><p>
1374 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1377 <table cellpadding="0" cellspacing="0" border="0">
1379 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::FindChannel </td>
1380 <td class="md" valign="top">( </td>
1381 <td class="md" nowrap valign="top">std::string </td>
1382 <td class="mdname1" valign="top" nowrap> <em>channel</em> </td>
1383 <td class="md" valign="top"> ) </td>
1384 <td class="md" nowrap><code> [virtual]</code></td>
1391 <table cellspacing=5 cellpadding=0 border=0>
1399 Attempts to look up a channel and return a pointer to it.
1401 This function will return NULL if the channel does not exist.
1403 Definition at line <a class="el" href="modules_8cpp-source.html#l00607">607</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1405 <div class="fragment"><pre>00608 {
1406 00609 <span class="keywordflow">return</span> FindChan(channel.c_str());
1411 <a name="a16" doxytag="Server::FindDescriptor"></a><p>
1412 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1415 <table cellpadding="0" cellspacing="0" border="0">
1417 <td class="md" nowrap valign="top"> <a class="el" href="classuserrec.html">userrec</a> * Server::FindDescriptor </td>
1418 <td class="md" valign="top">( </td>
1419 <td class="md" nowrap valign="top">int </td>
1420 <td class="mdname1" valign="top" nowrap> <em>socket</em> </td>
1421 <td class="md" valign="top"> ) </td>
1422 <td class="md" nowrap><code> [virtual]</code></td>
1429 <table cellspacing=5 cellpadding=0 border=0>
1437 Attempts to look up a nick using the file descriptor associated with that nick.
1439 This function will return NULL if the file descriptor is not associated with a valid user.
1441 Definition at line <a class="el" href="modules_8cpp-source.html#l00602">602</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1443 References <a class="el" href="modules_8cpp-source.html#l00119">fd_ref_table</a>.
1445 <div class="fragment"><pre>00603 {
1446 00604 <span class="keywordflow">return</span> (socket < 65536 ? <a class="code" href="modules_8cpp.html#a38">fd_ref_table</a>[socket] : NULL);
1451 <a name="a59" doxytag="Server::FindModule"></a><p>
1452 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1455 <table cellpadding="0" cellspacing="0" border="0">
1457 <td class="md" nowrap valign="top"> <a class="el" href="classModule.html">Module</a> * Server::FindModule </td>
1458 <td class="md" valign="top">( </td>
1459 <td class="md" nowrap valign="top">std::string </td>
1460 <td class="mdname1" valign="top" nowrap> <em>name</em> </td>
1461 <td class="md" valign="top"> ) </td>
1462 <td class="md" nowrap><code> [virtual]</code></td>
1469 <table cellspacing=5 cellpadding=0 border=0>
1477 This function finds a module by name.
1479 You must provide the filename of the module. If the module cannot be found (is not loaded) the function will return NULL.
1481 Definition at line <a class="el" href="modules_8cpp-source.html#l00858">858</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1483 References <a class="el" href="modules_8cpp-source.html#l01067">MODCOUNT</a>, <a class="el" href="channels_8cpp-source.html#l00092">module_names</a>, and <a class="el" href="channels_8cpp-source.html#l00064">modules</a>.
1485 <div class="fragment"><pre>00859 {
1486 00860 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i <= <a class="code" href="modules_8cpp.html#a1">MODCOUNT</a>; i++)
1488 00862 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#a27">module_names</a>[i] == name)
1490 00864 <span class="keywordflow">return</span> <a class="code" href="channels_8cpp.html#a2">modules</a>[i];
1493 00867 <span class="keywordflow">return</span> NULL;
1498 <a name="a15" doxytag="Server::FindNick"></a><p>
1499 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1502 <table cellpadding="0" cellspacing="0" border="0">
1504 <td class="md" nowrap valign="top"> <a class="el" href="classuserrec.html">userrec</a> * Server::FindNick </td>
1505 <td class="md" valign="top">( </td>
1506 <td class="md" nowrap valign="top">std::string </td>
1507 <td class="mdname1" valign="top" nowrap> <em>nick</em> </td>
1508 <td class="md" valign="top"> ) </td>
1509 <td class="md" nowrap><code> [virtual]</code></td>
1516 <table cellspacing=5 cellpadding=0 border=0>
1524 Attempts to look up a nick and return a pointer to it.
1526 This function will return NULL if the nick does not exist.
1528 Definition at line <a class="el" href="modules_8cpp-source.html#l00597">597</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1530 <div class="fragment"><pre>00598 {
1531 00599 <span class="keywordflow">return</span> Find(nick);
1536 <a name="a22" doxytag="Server::GetAdmin"></a><p>
1537 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1540 <table cellpadding="0" cellspacing="0" border="0">
1542 <td class="md" nowrap valign="top"> <a class="el" href="classAdmin.html">Admin</a> Server::GetAdmin </td>
1543 <td class="md" valign="top">( </td>
1544 <td class="mdname1" valign="top" nowrap> </td>
1545 <td class="md" valign="top"> ) </td>
1546 <td class="md" nowrap><code> [virtual]</code></td>
1553 <table cellspacing=5 cellpadding=0 border=0>
1561 Returns the information of the server as returned by the /ADMIN command.
1563 See the <a class="el" href="classAdmin.html">Admin</a> class for further information of the return value. The members <a class="el" href="classAdmin.html#o2">Admin::Nick</a>, <a class="el" href="classAdmin.html#o1">Admin::Email</a> and <a class="el" href="classAdmin.html#o0">Admin::Name</a> contain the information for the server where the module is loaded.
1565 Definition at line <a class="el" href="modules_8cpp-source.html#l00632">632</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1567 <div class="fragment"><pre>00633 {
1568 00634 <span class="keywordflow">return</span> <a class="code" href="classAdmin.html">Admin</a>(getadminname(),getadminemail(),getadminnick());
1573 <a name="a21" doxytag="Server::GetNetworkName"></a><p>
1574 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1577 <table cellpadding="0" cellspacing="0" border="0">
1579 <td class="md" nowrap valign="top"> std::string Server::GetNetworkName </td>
1580 <td class="md" valign="top">( </td>
1581 <td class="mdname1" valign="top" nowrap> </td>
1582 <td class="md" valign="top"> ) </td>
1583 <td class="md" nowrap><code> [virtual]</code></td>
1590 <table cellspacing=5 cellpadding=0 border=0>
1598 Returns the network name, global to all linked servers.
1602 Definition at line <a class="el" href="modules_8cpp-source.html#l00627">627</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1604 <div class="fragment"><pre>00628 {
1605 00629 <span class="keywordflow">return</span> getnetworkname();
1610 <a name="a20" doxytag="Server::GetServerName"></a><p>
1611 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1614 <table cellpadding="0" cellspacing="0" border="0">
1616 <td class="md" nowrap valign="top"> std::string Server::GetServerName </td>
1617 <td class="md" valign="top">( </td>
1618 <td class="mdname1" valign="top" nowrap> </td>
1619 <td class="md" valign="top"> ) </td>
1620 <td class="md" nowrap><code> [virtual]</code></td>
1627 <table cellspacing=5 cellpadding=0 border=0>
1635 Returns the server name of the server where the module is loaded.
1639 Definition at line <a class="el" href="modules_8cpp-source.html#l00622">622</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1641 <div class="fragment"><pre>00623 {
1642 00624 <span class="keywordflow">return</span> getservername();
1647 <a name="a37" doxytag="Server::GetUsers"></a><p>
1648 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1651 <table cellpadding="0" cellspacing="0" border="0">
1653 <td class="md" nowrap valign="top"> <a class="el" href="modules_8h.html#a33">chanuserlist</a> Server::GetUsers </td>
1654 <td class="md" valign="top">( </td>
1655 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
1656 <td class="mdname1" valign="top" nowrap> <em>chan</em> </td>
1657 <td class="md" valign="top"> ) </td>
1658 <td class="md" nowrap><code> [virtual]</code></td>
1665 <table cellspacing=5 cellpadding=0 border=0>
1673 Fetches the userlist of a channel.
1675 This function must be here and not a member of userrec or chanrec due to include constraints.
1677 Definition at line <a class="el" href="modules_8cpp-source.html#l00467">467</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1679 References <a class="el" href="modules_8h-source.html#l00072">chanuserlist</a>, <a class="el" href="channels_8cpp-source.html#l00227">chanrec::GetUsers()</a>, and <a class="el" href="channels_8cpp-source.html#l00078">list</a>.
1681 <div class="fragment"><pre>00468 {
1682 00469 <a class="code" href="modules_8h.html#a33">chanuserlist</a> userl;
1683 00470 userl.clear();
1684 00471 std::vector<char*> *<a class="code" href="channels_8cpp.html#a15">list</a> = chan-><a class="code" href="classchanrec.html#a7">GetUsers</a>();
1685 00472 <span class="keywordflow">for</span> (std::vector<char*>::iterator i = <a class="code" href="channels_8cpp.html#a15">list</a>->begin(); i != <a class="code" href="channels_8cpp.html#a15">list</a>->end(); i++)
1687 00474 <span class="keywordtype">char</span>* o = *i;
1688 00475 userl.push_back((<a class="code" href="classuserrec.html">userrec</a>*)o);
1690 00477 <span class="keywordflow">return</span> userl;
1695 <a name="a13" doxytag="Server::IsNick"></a><p>
1696 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1699 <table cellpadding="0" cellspacing="0" border="0">
1701 <td class="md" nowrap valign="top"> bool Server::IsNick </td>
1702 <td class="md" valign="top">( </td>
1703 <td class="md" nowrap valign="top">std::string </td>
1704 <td class="mdname1" valign="top" nowrap> <em>nick</em> </td>
1705 <td class="md" valign="top"> ) </td>
1706 <td class="md" nowrap><code> [virtual]</code></td>
1713 <table cellspacing=5 cellpadding=0 border=0>
1721 Returns true if a nick is valid.
1723 Nicks for unregistered connections will return false.
1725 Definition at line <a class="el" href="modules_8cpp-source.html#l00592">592</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1727 References <a class="el" href="message_8h.html#a13">isnick()</a>.
1729 <div class="fragment"><pre>00593 {
1730 00594 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a13">isnick</a>(nick.c_str()) != 0);
1735 <a name="a19" doxytag="Server::IsOnChannel"></a><p>
1736 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1739 <table cellpadding="0" cellspacing="0" border="0">
1741 <td class="md" nowrap valign="top"> bool Server::IsOnChannel </td>
1742 <td class="md" valign="top">( </td>
1743 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1744 <td class="mdname" nowrap> <em>User</em>, </td>
1749 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
1750 <td class="mdname" nowrap> <em>Chan</em></td>
1754 <td class="md">) </td>
1755 <td class="md" colspan="2"><code> [virtual]</code></td>
1762 <table cellspacing=5 cellpadding=0 border=0>
1770 Checks if a user is on a channel.
1772 This function will return true or false to indicate if user 'User' is on channel 'Chan'.
1774 Definition at line <a class="el" href="modules_8cpp-source.html#l00617">617</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1776 References <a class="el" href="message_8h.html#a16">has_channel()</a>.
1778 <div class="fragment"><pre>00618 {
1779 00619 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a16">has_channel</a>(User,Chan);
1784 <a name="a36" doxytag="Server::IsUlined"></a><p>
1785 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1788 <table cellpadding="0" cellspacing="0" border="0">
1790 <td class="md" nowrap valign="top"> bool Server::IsUlined </td>
1791 <td class="md" valign="top">( </td>
1792 <td class="md" nowrap valign="top">std::string </td>
1793 <td class="mdname1" valign="top" nowrap> <em>server</em> </td>
1794 <td class="md" valign="top"> ) </td>
1795 <td class="md" nowrap><code> [virtual]</code></td>
1802 <table cellspacing=5 cellpadding=0 border=0>
1810 Returns true if the servername you give is ulined.
1812 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.
1814 Definition at line <a class="el" href="modules_8cpp-source.html#l00489">489</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1816 References <a class="el" href="commands_8h.html#a74">is_uline()</a>.
1818 <div class="fragment"><pre>00490 {
1819 00491 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a74">is_uline</a>(server.c_str());
1824 <a name="a51" doxytag="Server::IsValidMask"></a><p>
1825 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1828 <table cellpadding="0" cellspacing="0" border="0">
1830 <td class="md" nowrap valign="top"> bool Server::IsValidMask </td>
1831 <td class="md" valign="top">( </td>
1832 <td class="md" nowrap valign="top">std::string </td>
1833 <td class="mdname1" valign="top" nowrap> <em>mask</em> </td>
1834 <td class="md" valign="top"> ) </td>
1835 <td class="md" nowrap><code> [virtual]</code></td>
1842 <table cellspacing=5 cellpadding=0 border=0>
1850 Returns true if a nick!ident string is correctly formatted, false if otherwise.
1854 Definition at line <a class="el" href="modules_8cpp-source.html#l00785">785</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1856 <div class="fragment"><pre>00786 {
1857 00787 <span class="keyword">const</span> <span class="keywordtype">char</span>* dest = mask.c_str();
1858 00788 <span class="keywordflow">if</span> (strchr(dest,<span class="charliteral">'!'</span>)==0)
1859 00789 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1860 00790 <span class="keywordflow">if</span> (strchr(dest,<span class="charliteral">'@'</span>)==0)
1861 00791 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1862 00792 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1863 00793 <span class="keywordflow">if</span> (dest[i] < 32)
1864 00794 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1865 00795 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1866 00796 <span class="keywordflow">if</span> (dest[i] > 126)
1867 00797 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1868 00798 <span class="keywordtype">int</span> c = 0;
1869 00799 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1870 00800 <span class="keywordflow">if</span> (dest[i] == <span class="charliteral">'!'</span>)
1872 00802 <span class="keywordflow">if</span> (c>1)
1873 00803 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1875 00805 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1876 00806 <span class="keywordflow">if</span> (dest[i] == <span class="charliteral">'@'</span>)
1878 00808 <span class="keywordflow">if</span> (c>1)
1879 00809 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1881 00811 <span class="keywordflow">return</span> <span class="keyword">true</span>;
1886 <a name="a28" doxytag="Server::JoinUserToChannel"></a><p>
1887 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1890 <table cellpadding="0" cellspacing="0" border="0">
1892 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::JoinUserToChannel </td>
1893 <td class="md" valign="top">( </td>
1894 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1895 <td class="mdname" nowrap> <em>user</em>, </td>
1900 <td class="md" nowrap>std::string </td>
1901 <td class="mdname" nowrap> <em>cname</em>, </td>
1906 <td class="md" nowrap>std::string </td>
1907 <td class="mdname" nowrap> <em>key</em></td>
1911 <td class="md">) </td>
1912 <td class="md" colspan="2"><code> [virtual]</code></td>
1919 <table cellspacing=5 cellpadding=0 border=0>
1927 Forces a user to join a channel.
1929 This is similar to svsjoin and can be used to implement redirection, etc. On success, the return value is a valid pointer to a chanrec* of the channel the user was joined to. On failure, the result is NULL.
1931 Definition at line <a class="el" href="modules_8cpp-source.html#l00457">457</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1933 <div class="fragment"><pre>00458 {
1934 00459 <span class="keywordflow">return</span> add_channel(user,cname.c_str(),key.c_str(),<span class="keyword">false</span>);
1939 <a name="a3" doxytag="Server::Log"></a><p>
1940 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1943 <table cellpadding="0" cellspacing="0" border="0">
1945 <td class="md" nowrap valign="top"> void Server::Log </td>
1946 <td class="md" valign="top">( </td>
1947 <td class="md" nowrap valign="top">int </td>
1948 <td class="mdname" nowrap> <em>level</em>, </td>
1953 <td class="md" nowrap>std::string </td>
1954 <td class="mdname" nowrap> <em>s</em></td>
1958 <td class="md">) </td>
1959 <td class="md" colspan="2"><code> [virtual]</code></td>
1966 <table cellspacing=5 cellpadding=0 border=0>
1974 Writes a log string.
1976 This method writes a line of text to the log. If the level given is lower than the level given in the configuration, this command has no effect.
1978 Definition at line <a class="el" href="modules_8cpp-source.html#l00499">499</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1980 <div class="fragment"><pre>00500 {
1981 00501 log(level,<span class="stringliteral">"%s"</span>,s.c_str());
1986 <a name="a32" doxytag="Server::MatchText"></a><p>
1987 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1990 <table cellpadding="0" cellspacing="0" border="0">
1992 <td class="md" nowrap valign="top"> bool Server::MatchText </td>
1993 <td class="md" valign="top">( </td>
1994 <td class="md" nowrap valign="top">std::string </td>
1995 <td class="mdname" nowrap> <em>sliteral</em>, </td>
2000 <td class="md" nowrap>std::string </td>
2001 <td class="mdname" nowrap> <em>spattern</em></td>
2005 <td class="md">) </td>
2006 <td class="md" colspan="2"><code> [virtual]</code></td>
2013 <table cellspacing=5 cellpadding=0 border=0>
2021 Matches text against a glob pattern.
2023 Uses the ircd's internal matching function to match string against a globbing pattern, e.g. *!*@*.com Returns true if the literal successfully matches the pattern, false if otherwise.
2025 Definition at line <a class="el" href="modules_8cpp-source.html#l00444">444</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2027 <div class="fragment"><pre>00445 {
2028 00446 <span class="keywordtype">char</span> literal[MAXBUF],pattern[MAXBUF];
2029 00447 strlcpy(literal,sliteral.c_str(),MAXBUF);
2030 00448 strlcpy(pattern,spattern.c_str(),MAXBUF);
2031 00449 <span class="keywordflow">return</span> match(literal,pattern);
2036 <a name="a57" doxytag="Server::MeshCheckChan"></a><p>
2037 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2040 <table cellpadding="0" cellspacing="0" border="0">
2042 <td class="md" nowrap valign="top"> bool Server::MeshCheckChan </td>
2043 <td class="md" valign="top">( </td>
2044 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
2045 <td class="mdname" nowrap> <em>c</em>, </td>
2050 <td class="md" nowrap>std::string </td>
2051 <td class="mdname" nowrap> <em>servername</em></td>
2055 <td class="md">) </td>
2056 <td class="md" colspan="2"><code> [virtual]</code></td>
2063 <table cellspacing=5 cellpadding=0 border=0>
2071 This function is used to check if any users on channel c are on server servername.
2073 This is used internally by PRIVMSG etc. You should not need to use it.
2075 Definition at line <a class="el" href="modules_8cpp-source.html#l00840">840</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2077 <div class="fragment"><pre>00841 {
2078 00842 <span class="keywordflow">if</span> (c)
2080 00844 <span class="keywordflow">return</span> ChanAnyOnThisServer(c,(<span class="keywordtype">char</span>*)servername.c_str());
2082 00846 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;
2087 <a name="a58" doxytag="Server::MeshCheckCommon"></a><p>
2088 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2091 <table cellpadding="0" cellspacing="0" border="0">
2093 <td class="md" nowrap valign="top"> bool Server::MeshCheckCommon </td>
2094 <td class="md" valign="top">( </td>
2095 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2096 <td class="mdname" nowrap> <em>u</em>, </td>
2101 <td class="md" nowrap>std::string </td>
2102 <td class="mdname" nowrap> <em>servername</em></td>
2106 <td class="md">) </td>
2107 <td class="md" colspan="2"><code> [virtual]</code></td>
2114 <table cellspacing=5 cellpadding=0 border=0>
2122 This function is used to check if user u has any channels in common with users on servername.
2124 This is used internally by <a class="el" href="classServer.html#a53">Server::MeshSendCommon</a>. You should very rarely need to use it.
2126 Definition at line <a class="el" href="modules_8cpp-source.html#l00849">849</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2128 <div class="fragment"><pre>00850 {
2129 00851 <span class="keywordflow">if</span> (u)
2131 00853 <span class="keywordflow">return</span> CommonOnThisServer(u,(<span class="keywordtype">char</span>*)servername.c_str());
2133 00855 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;
2138 <a name="a52" doxytag="Server::MeshSendAll"></a><p>
2139 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2142 <table cellpadding="0" cellspacing="0" border="0">
2144 <td class="md" nowrap valign="top"> void Server::MeshSendAll </td>
2145 <td class="md" valign="top">( </td>
2146 <td class="md" nowrap valign="top">std::string </td>
2147 <td class="mdname1" valign="top" nowrap> <em>text</em> </td>
2148 <td class="md" valign="top"> ) </td>
2149 <td class="md" nowrap><code> [virtual]</code></td>
2156 <table cellspacing=5 cellpadding=0 border=0>
2164 Sends a line of text to all connected servers.
2166 If a server is not directly reachable, the core deals with routing the message, and will also deal with failures transparently.
2168 Definition at line <a class="el" href="modules_8cpp-source.html#l00814">814</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2170 <div class="fragment"><pre>00815 {
2171 00816 NetSendToAll((<span class="keywordtype">char</span>*)text.c_str());
2176 <a name="a54" doxytag="Server::MeshSendAllAlive"></a><p>
2177 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2180 <table cellpadding="0" cellspacing="0" border="0">
2182 <td class="md" nowrap valign="top"> void Server::MeshSendAllAlive </td>
2183 <td class="md" valign="top">( </td>
2184 <td class="md" nowrap valign="top">std::string </td>
2185 <td class="mdname1" valign="top" nowrap> <em>text</em> </td>
2186 <td class="md" valign="top"> ) </td>
2187 <td class="md" nowrap><code> [virtual]</code></td>
2194 <table cellspacing=5 cellpadding=0 border=0>
2202 This function is equivalent to Server::MeshSendToAll except it will only route to servers which are directly routable.
2206 Definition at line <a class="el" href="modules_8cpp-source.html#l00825">825</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2208 <div class="fragment"><pre>00826 {
2209 00827 NetSendToAllAlive((<span class="keywordtype">char</span>*)text.c_str());
2214 <a name="a56" doxytag="Server::MeshSendAllExcept"></a><p>
2215 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2218 <table cellpadding="0" cellspacing="0" border="0">
2220 <td class="md" nowrap valign="top"> void Server::MeshSendAllExcept </td>
2221 <td class="md" valign="top">( </td>
2222 <td class="md" nowrap valign="top">std::string </td>
2223 <td class="mdname" nowrap> <em>target</em>, </td>
2228 <td class="md" nowrap>std::string </td>
2229 <td class="mdname" nowrap> <em>text</em></td>
2233 <td class="md">) </td>
2234 <td class="md" colspan="2"><code> [virtual]</code></td>
2241 <table cellspacing=5 cellpadding=0 border=0>
2249 This function sends to all servers EXCEPT the one you specify.
2251 You should usually use this function to send messages, specifying the SENDER of your message as 'target'. This will prevent message loops.
2253 Definition at line <a class="el" href="modules_8cpp-source.html#l00835">835</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2255 <div class="fragment"><pre>00836 {
2256 00837 NetSendToAllExcept(target.c_str(),(<span class="keywordtype">char</span>*)text.c_str());
2261 <a name="a53" doxytag="Server::MeshSendCommon"></a><p>
2262 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2265 <table cellpadding="0" cellspacing="0" border="0">
2267 <td class="md" nowrap valign="top"> void Server::MeshSendCommon </td>
2268 <td class="md" valign="top">( </td>
2269 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2270 <td class="mdname" nowrap> <em>user</em>, </td>
2275 <td class="md" nowrap>std::string </td>
2276 <td class="mdname" nowrap> <em>text</em></td>
2280 <td class="md">) </td>
2281 <td class="md" colspan="2"><code> [virtual]</code></td>
2288 <table cellspacing=5 cellpadding=0 border=0>
2296 This method sends a line of text to all servers who have users which share common channels with the user you provide.
2298 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!)
2300 Definition at line <a class="el" href="modules_8cpp-source.html#l00819">819</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2302 <div class="fragment"><pre>00820 {
2303 00821 <span class="keywordflow">if</span> (user)
2304 00822 NetSendToCommon(user,(<span class="keywordtype">char</span>*)text.c_str());
2309 <a name="a55" doxytag="Server::MeshSendUnicast"></a><p>
2310 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2313 <table cellpadding="0" cellspacing="0" border="0">
2315 <td class="md" nowrap valign="top"> void Server::MeshSendUnicast </td>
2316 <td class="md" valign="top">( </td>
2317 <td class="md" nowrap valign="top">std::string </td>
2318 <td class="mdname" nowrap> <em>destination</em>, </td>
2323 <td class="md" nowrap>std::string </td>
2324 <td class="mdname" nowrap> <em>text</em></td>
2328 <td class="md">) </td>
2329 <td class="md" colspan="2"><code> [virtual]</code></td>
2336 <table cellspacing=5 cellpadding=0 border=0>
2344 This function sends a line of text directly to a server.
2346 If the server is not directly routable at this time, the server attempts to route text through the mesh.
2348 Definition at line <a class="el" href="modules_8cpp-source.html#l00830">830</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2350 <div class="fragment"><pre>00831 {
2351 00832 NetSendToOne((<span class="keywordtype">char</span>*)destination.c_str(),(<span class="keywordtype">char</span>*)text.c_str());
2356 <a name="a29" doxytag="Server::PartUserFromChannel"></a><p>
2357 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2360 <table cellpadding="0" cellspacing="0" border="0">
2362 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::PartUserFromChannel </td>
2363 <td class="md" valign="top">( </td>
2364 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2365 <td class="mdname" nowrap> <em>user</em>, </td>
2370 <td class="md" nowrap>std::string </td>
2371 <td class="mdname" nowrap> <em>cname</em>, </td>
2376 <td class="md" nowrap>std::string </td>
2377 <td class="mdname" nowrap> <em>reason</em></td>
2381 <td class="md">) </td>
2382 <td class="md" colspan="2"><code> [virtual]</code></td>
2389 <table cellspacing=5 cellpadding=0 border=0>
2397 Forces a user to part a channel.
2399 This is similar to svspart and can be used to implement redirection, etc. Although the return value of this function is a pointer to a channel record, the returned data is undefined and should not be read or written to. This behaviour may be changed in a future version.
2401 Definition at line <a class="el" href="modules_8cpp-source.html#l00462">462</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2403 <div class="fragment"><pre>00463 {
2404 00464 <span class="keywordflow">return</span> del_channel(user,cname.c_str(),reason.c_str(),<span class="keyword">false</span>);
2409 <a name="a39" doxytag="Server::PseudoToUser"></a><p>
2410 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2413 <table cellpadding="0" cellspacing="0" border="0">
2415 <td class="md" nowrap valign="top"> bool Server::PseudoToUser </td>
2416 <td class="md" valign="top">( </td>
2417 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2418 <td class="mdname" nowrap> <em>alive</em>, </td>
2423 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2424 <td class="mdname" nowrap> <em>zombie</em>, </td>
2429 <td class="md" nowrap>std::string </td>
2430 <td class="mdname" nowrap> <em>message</em></td>
2434 <td class="md">) </td>
2435 <td class="md" colspan="2"><code> [virtual]</code></td>
2442 <table cellspacing=5 cellpadding=0 border=0>
2450 This user takes one user, and switches their file descriptor with another user, so that one user "becomes" the other.
2452 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.
2454 Definition at line <a class="el" href="modules_8cpp-source.html#l00700">700</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2456 References <a class="el" href="channels_8h-source.html#l00233">ucrec::channel</a>, <a class="el" href="users_8h-source.html#l00142">userrec::chans</a>, <a class="el" href="users_8cpp-source.html#l00203">userrec::ClearBuffer()</a>, <a class="el" href="connection_8h-source.html#l00215">connection::fd</a>, <a class="el" href="modules_8h-source.html#l00099">FD_MAGIC_NUMBER</a>, <a class="el" href="modules_8cpp-source.html#l00119">fd_ref_table</a>, <a class="el" href="connection_8h-source.html#l00219">connection::host</a>, <a class="el" href="users_8h-source.html#l00125">userrec::ident</a>, <a class="el" href="channels_8h-source.html#l00106">chanrec::name</a>, <a class="el" href="users_8h-source.html#l00121">userrec::nick</a>, <a class="el" href="channels_8h-source.html#l00131">chanrec::setby</a>, <a class="el" href="channels_8h-source.html#l00120">chanrec::topic</a>, and <a class="el" href="channels_8h-source.html#l00127">chanrec::topicset</a>.
2458 <div class="fragment"><pre>00701 {
2459 00702 zombie-><a class="code" href="classconnection.html#o0">fd</a> = alive-><a class="code" href="classconnection.html#o0">fd</a>;
2460 00703 alive-><a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="modules_8h.html#a26">FD_MAGIC_NUMBER</a>;
2461 00704 alive-><a class="code" href="classuserrec.html#a10">ClearBuffer</a>();
2462 00705 Write(zombie-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">":%s!%s@%s NICK %s"</span>,alive-><a class="code" href="classuserrec.html#o0">nick</a>,alive-><a class="code" href="classuserrec.html#o1">ident</a>,alive-><a class="code" href="classconnection.html#o1">host</a>,zombie-><a class="code" href="classuserrec.html#o0">nick</a>);
2463 00706 kill_link(alive,message.c_str());
2464 00707 <a class="code" href="modules_8cpp.html#a38">fd_ref_table</a>[zombie-><a class="code" href="classconnection.html#o0">fd</a>] = zombie;
2465 00708 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i != MAXCHANS; i++)
2467 00710 <span class="keywordflow">if</span> (zombie->chans[i].channel != NULL)
2469 00712 <span class="keywordflow">if</span> (zombie->chans[i].channel->name)
2471 00714 <a class="code" href="classchanrec.html">chanrec</a>* Ptr = zombie-><a class="code" href="classuserrec.html#o5">chans</a>[i].<a class="code" href="classucrec.html#o1">channel</a>;
2472 00715 WriteFrom(zombie->fd,zombie,<span class="stringliteral">"JOIN %s"</span>,Ptr-><a class="code" href="classchanrec.html#o0">name</a>);
2473 00716 <span class="keywordflow">if</span> (Ptr-><a class="code" href="classchanrec.html#o5">topicset</a>)
2475 00718 WriteServ(zombie->fd,<span class="stringliteral">"332 %s %s :%s"</span>, zombie->nick, Ptr-><a class="code" href="classchanrec.html#o0">name</a>, Ptr-><a class="code" href="classchanrec.html#o3">topic</a>);
2476 00719 WriteServ(zombie->fd,<span class="stringliteral">"333 %s %s %s %d"</span>, zombie->nick, Ptr-><a class="code" href="classchanrec.html#o0">name</a>, Ptr-><a class="code" href="classchanrec.html#o6">setby</a>, Ptr-><a class="code" href="classchanrec.html#o5">topicset</a>);
2478 00721 userlist(zombie,Ptr);
2479 00722 WriteServ(zombie->fd,<span class="stringliteral">"366 %s %s :End of /NAMES list."</span>, zombie->nick, Ptr-><a class="code" href="classchanrec.html#o0">name</a>);
2489 <a name="a31" doxytag="Server::QuitUser"></a><p>
2490 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2493 <table cellpadding="0" cellspacing="0" border="0">
2495 <td class="md" nowrap valign="top"> void Server::QuitUser </td>
2496 <td class="md" valign="top">( </td>
2497 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2498 <td class="mdname" nowrap> <em>user</em>, </td>
2503 <td class="md" nowrap>std::string </td>
2504 <td class="mdname" nowrap> <em>reason</em></td>
2508 <td class="md">) </td>
2509 <td class="md" colspan="2"><code> [virtual]</code></td>
2516 <table cellspacing=5 cellpadding=0 border=0>
2524 Forces a user to quit with the specified reason.
2526 To the user, it will appear as if they typed /QUIT themselves, except for the fact that this function may bypass the quit prefix specified in the config file.<p>
2528 Once you call this function, userrec* user will immediately become INVALID. You MUST NOT write to, or read from this pointer after calling the QuitUser method UNDER ANY CIRCUMSTANCES! The best course of action after calling this method is to immediately bail from your handler.
2530 Definition at line <a class="el" href="modules_8cpp-source.html#l00484">484</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2532 <div class="fragment"><pre>00485 {
2533 00486 kill_link(user,reason.c_str());
2538 <a name="a4" doxytag="Server::Send"></a><p>
2539 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2542 <table cellpadding="0" cellspacing="0" border="0">
2544 <td class="md" nowrap valign="top"> void Server::Send </td>
2545 <td class="md" valign="top">( </td>
2546 <td class="md" nowrap valign="top">int </td>
2547 <td class="mdname" nowrap> <em>Socket</em>, </td>
2552 <td class="md" nowrap>std::string </td>
2553 <td class="mdname" nowrap> <em>s</em></td>
2557 <td class="md">) </td>
2558 <td class="md" colspan="2"><code> [virtual]</code></td>
2565 <table cellspacing=5 cellpadding=0 border=0>
2573 Sends a line of text down a TCP/IP socket.
2575 This method writes a line of text to an established socket, cutting it to 510 characters plus a carriage return and linefeed if required.
2577 Definition at line <a class="el" href="modules_8cpp-source.html#l00514">514</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2579 <div class="fragment"><pre>00515 {
2580 00516 Write(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
2585 <a name="a9" doxytag="Server::SendChannel"></a><p>
2586 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2589 <table cellpadding="0" cellspacing="0" border="0">
2591 <td class="md" nowrap valign="top"> void Server::SendChannel </td>
2592 <td class="md" valign="top">( </td>
2593 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2594 <td class="mdname" nowrap> <em>User</em>, </td>
2599 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
2600 <td class="mdname" nowrap> <em>Channel</em>, </td>
2605 <td class="md" nowrap>std::string </td>
2606 <td class="mdname" nowrap> <em>s</em>, </td>
2611 <td class="md" nowrap>bool </td>
2612 <td class="mdname" nowrap> <em>IncludeSender</em></td>
2616 <td class="md">) </td>
2617 <td class="md" colspan="2"><code> [virtual]</code></td>
2624 <table cellspacing=5 cellpadding=0 border=0>
2632 Sends text from a user to a channel (mulicast).
2634 This method writes a line of text to a channel, with the given user's nick/ident /host combination prepended, as used in PRIVMSG etc commands (see RFC 1459). If the IncludeSender flag is set, then the text is also sent back to the user from which it originated, as seen in MODE (see RFC 1459).
2636 Definition at line <a class="el" href="modules_8cpp-source.html#l00548">548</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2638 <div class="fragment"><pre>00549 {
2639 00550 <span class="keywordflow">if</span> (IncludeSender)
2641 00552 WriteChannel(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
2643 00554 <span class="keywordflow">else</span>
2645 00556 ChanExceptSender(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
2651 <a name="a6" doxytag="Server::SendChannelServerNotice"></a><p>
2652 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2655 <table cellpadding="0" cellspacing="0" border="0">
2657 <td class="md" nowrap valign="top"> void Server::SendChannelServerNotice </td>
2658 <td class="md" valign="top">( </td>
2659 <td class="md" nowrap valign="top">std::string </td>
2660 <td class="mdname" nowrap> <em>ServName</em>, </td>
2665 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
2666 <td class="mdname" nowrap> <em>Channel</em>, </td>
2671 <td class="md" nowrap>std::string </td>
2672 <td class="mdname" nowrap> <em>text</em></td>
2676 <td class="md">) </td>
2677 <td class="md" colspan="2"><code> [virtual]</code></td>
2684 <table cellspacing=5 cellpadding=0 border=0>
2692 Writes text to a channel, but from a server, including all.
2694 This can be used to send server notices to a group of users.
2696 Definition at line <a class="el" href="modules_8cpp-source.html#l00543">543</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2698 <div class="fragment"><pre>00544 {
2699 00545 WriteChannelWithServ((<span class="keywordtype">char</span>*)ServName.c_str(), Channel, <span class="stringliteral">"%s"</span>, text.c_str());
2704 <a name="a11" doxytag="Server::SendCommon"></a><p>
2705 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2708 <table cellpadding="0" cellspacing="0" border="0">
2710 <td class="md" nowrap valign="top"> void Server::SendCommon </td>
2711 <td class="md" valign="top">( </td>
2712 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2713 <td class="mdname" nowrap> <em>User</em>, </td>
2718 <td class="md" nowrap>std::string </td>
2719 <td class="mdname" nowrap> <em>text</em>, </td>
2724 <td class="md" nowrap>bool </td>
2725 <td class="mdname" nowrap> <em>IncludeSender</em></td>
2729 <td class="md">) </td>
2730 <td class="md" colspan="2"><code> [virtual]</code></td>
2737 <table cellspacing=5 cellpadding=0 border=0>
2745 Sends text from a user to one or more channels (mulicast).
2747 This method writes a line of text to all users which share a common channel with a given user, with the user's nick/ident/host combination prepended, as used in PRIVMSG etc commands (see RFC 1459). If the IncludeSender flag is set, then the text is also sent back to the user from which it originated, as seen in NICK (see RFC 1459). Otherwise, it is only sent to the other recipients, as seen in QUIT.
2749 Definition at line <a class="el" href="modules_8cpp-source.html#l00565">565</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2751 <div class="fragment"><pre>00566 {
2752 00567 <span class="keywordflow">if</span> (IncludeSender)
2754 00569 WriteCommon(User,<span class="stringliteral">"%s"</span>,text.c_str());
2756 00571 <span class="keywordflow">else</span>
2758 00573 WriteCommonExcept(User,<span class="stringliteral">"%s"</span>,text.c_str());
2764 <a name="a7" doxytag="Server::SendFrom"></a><p>
2765 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2768 <table cellpadding="0" cellspacing="0" border="0">
2770 <td class="md" nowrap valign="top"> void Server::SendFrom </td>
2771 <td class="md" valign="top">( </td>
2772 <td class="md" nowrap valign="top">int </td>
2773 <td class="mdname" nowrap> <em>Socket</em>, </td>
2778 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2779 <td class="mdname" nowrap> <em>User</em>, </td>
2784 <td class="md" nowrap>std::string </td>
2785 <td class="mdname" nowrap> <em>s</em></td>
2789 <td class="md">) </td>
2790 <td class="md" colspan="2"><code> [virtual]</code></td>
2797 <table cellspacing=5 cellpadding=0 border=0>
2805 Sends text from a user to a socket.
2807 This method writes a line of text to an established socket, with the given user's nick/ident /host combination prepended, as used in PRIVSG etc commands (see RFC 1459)
2809 Definition at line <a class="el" href="modules_8cpp-source.html#l00524">524</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2811 <div class="fragment"><pre>00525 {
2812 00526 WriteFrom(Socket,User,<span class="stringliteral">"%s"</span>,s.c_str());
2817 <a name="a26" doxytag="Server::SendMode"></a><p>
2818 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2821 <table cellpadding="0" cellspacing="0" border="0">
2823 <td class="md" nowrap valign="top"> void Server::SendMode </td>
2824 <td class="md" valign="top">( </td>
2825 <td class="md" nowrap valign="top">char ** </td>
2826 <td class="mdname" nowrap> <em>parameters</em>, </td>
2831 <td class="md" nowrap>int </td>
2832 <td class="mdname" nowrap> <em>pcnt</em>, </td>
2837 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2838 <td class="mdname" nowrap> <em>user</em></td>
2842 <td class="md">) </td>
2843 <td class="md" colspan="2"><code> [virtual]</code></td>
2850 <table cellspacing=5 cellpadding=0 border=0>
2860 you must format the parameters array with the target, modes and parameters for those modes.<p>
2863 modes[0] = ChannelName;<p>
2865 modes[2] = user->nick;<p>
2866 Srv->SendMode(modes,3,user);<p>
2867 The modes will originate from the server where the command was issued, however responses (e.g. numerics) will be sent to the user you provide as the third parameter. You must be sure to get the number of parameters correct in the pcnt parameter otherwise you could leave your server in an unstable state!
2869 Definition at line <a class="el" href="modules_8cpp-source.html#l00509">509</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2871 References <a class="el" href="modules_8h.html#a36">server_mode()</a>.
2873 <div class="fragment"><pre>00510 {
2874 00511 <a class="code" href="modules_8h.html#a36">server_mode</a>(parameters,pcnt,user);
2879 <a name="a2" doxytag="Server::SendOpers"></a><p>
2880 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2883 <table cellpadding="0" cellspacing="0" border="0">
2885 <td class="md" nowrap valign="top"> void Server::SendOpers </td>
2886 <td class="md" valign="top">( </td>
2887 <td class="md" nowrap valign="top">std::string </td>
2888 <td class="mdname1" valign="top" nowrap> <em>s</em> </td>
2889 <td class="md" valign="top"> ) </td>
2890 <td class="md" nowrap><code> [virtual]</code></td>
2897 <table cellspacing=5 cellpadding=0 border=0>
2905 Sends text to all opers.
2907 This method sends a server notice to all opers with the usermode +s.
2909 Definition at line <a class="el" href="modules_8cpp-source.html#l00439">439</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2911 <div class="fragment"><pre>00440 {
2912 00441 WriteOpers(<span class="stringliteral">"%s"</span>,s.c_str());
2917 <a name="a5" doxytag="Server::SendServ"></a><p>
2918 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2921 <table cellpadding="0" cellspacing="0" border="0">
2923 <td class="md" nowrap valign="top"> void Server::SendServ </td>
2924 <td class="md" valign="top">( </td>
2925 <td class="md" nowrap valign="top">int </td>
2926 <td class="mdname" nowrap> <em>Socket</em>, </td>
2931 <td class="md" nowrap>std::string </td>
2932 <td class="mdname" nowrap> <em>s</em></td>
2936 <td class="md">) </td>
2937 <td class="md" colspan="2"><code> [virtual]</code></td>
2944 <table cellspacing=5 cellpadding=0 border=0>
2952 Sends text from the server to a socket.
2954 This method writes a line of text to an established socket, with the servername prepended as used by numerics (see RFC 1459)
2956 Definition at line <a class="el" href="modules_8cpp-source.html#l00519">519</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2958 <div class="fragment"><pre>00520 {
2959 00521 WriteServ(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
2964 <a name="a8" doxytag="Server::SendTo"></a><p>
2965 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2968 <table cellpadding="0" cellspacing="0" border="0">
2970 <td class="md" nowrap valign="top"> void Server::SendTo </td>
2971 <td class="md" valign="top">( </td>
2972 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2973 <td class="mdname" nowrap> <em>Source</em>, </td>
2978 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2979 <td class="mdname" nowrap> <em>Dest</em>, </td>
2984 <td class="md" nowrap>std::string </td>
2985 <td class="mdname" nowrap> <em>s</em></td>
2989 <td class="md">) </td>
2990 <td class="md" colspan="2"><code> [virtual]</code></td>
2997 <table cellspacing=5 cellpadding=0 border=0>
3005 Sends text from a user to another user.
3007 This method writes a line of text to a user, with a user's nick/ident /host combination prepended, as used in PRIVMSG etc commands (see RFC 1459) If you specify NULL as the source, then the data will originate from the local server, e.g. instead of:<p>
3009 The format will become:<p>
3010 :localserver TEXT<p>
3011 Which is useful for numerics and server notices to single users, etc.
3013 Definition at line <a class="el" href="modules_8cpp-source.html#l00529">529</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
3015 References <a class="el" href="connection_8h-source.html#l00215">connection::fd</a>.
3017 <div class="fragment"><pre>00530 {
3018 00531 <span class="keywordflow">if</span> (!Source)
3020 00533 <span class="comment">// if source is NULL, then the message originates from the local server</span>
3021 00534 Write(Dest-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">":%s %s"</span>,this->GetServerName().c_str(),s.c_str());
3023 00536 <span class="keywordflow">else</span>
3025 00538 <span class="comment">// otherwise it comes from the user specified</span>
3026 00539 WriteTo(Source,Dest,<span class="stringliteral">"%s"</span>,s.c_str());
3032 <a name="a27" doxytag="Server::SendToModeMask"></a><p>
3033 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3036 <table cellpadding="0" cellspacing="0" border="0">
3038 <td class="md" nowrap valign="top"> void Server::SendToModeMask </td>
3039 <td class="md" valign="top">( </td>
3040 <td class="md" nowrap valign="top">std::string </td>
3041 <td class="mdname" nowrap> <em>modes</em>, </td>
3046 <td class="md" nowrap>int </td>
3047 <td class="mdname" nowrap> <em>flags</em>, </td>
3052 <td class="md" nowrap>std::string </td>
3053 <td class="mdname" nowrap> <em>text</em></td>
3057 <td class="md">) </td>
3058 <td class="md" colspan="2"><code> [virtual]</code></td>
3065 <table cellspacing=5 cellpadding=0 border=0>
3073 Sends to all users matching a mode mask You must specify one or more usermodes as the first parameter.
3075 These can be RFC specified modes such as +i, or module provided modes, including ones provided by your own module. In the second parameter you must place a flag value which indicates wether the modes you have given will be logically ANDed or OR'ed. You may use one of either WM_AND or WM_OR. for example, if you were to use:<p>
3076 Serv->SendToModeMask("xi", WM_OR, "m00");<p>
3077 Then the text 'm00' will be sent to all users with EITHER mode x or i. Conversely if you used WM_AND, the user must have both modes set to receive the message.
3079 Definition at line <a class="el" href="modules_8cpp-source.html#l00452">452</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
3081 <div class="fragment"><pre>00453 {
3082 00454 WriteMode(modes.c_str(),flags,<span class="stringliteral">"%s"</span>,text.c_str());
3087 <a name="a12" doxytag="Server::SendWallops"></a><p>
3088 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3091 <table cellpadding="0" cellspacing="0" border="0">
3093 <td class="md" nowrap valign="top"> void Server::SendWallops </td>
3094 <td class="md" valign="top">( </td>
3095 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
3096 <td class="mdname" nowrap> <em>User</em>, </td>
3101 <td class="md" nowrap>std::string </td>
3102 <td class="mdname" nowrap> <em>text</em></td>
3106 <td class="md">) </td>
3107 <td class="md" colspan="2"><code> [virtual]</code></td>
3114 <table cellspacing=5 cellpadding=0 border=0>
3122 Sends a WALLOPS message.
3124 This method writes a WALLOPS message to all users with the +w flag, originating from the specified user.
3126 Definition at line <a class="el" href="modules_8cpp-source.html#l00577">577</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
3128 <div class="fragment"><pre>00578 {
3129 00579 WriteWallOps(User,<span class="keyword">false</span>,<span class="stringliteral">"%s"</span>,text.c_str());
3134 <a name="a38" doxytag="Server::UserToPseudo"></a><p>
3135 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3138 <table cellpadding="0" cellspacing="0" border="0">
3140 <td class="md" nowrap valign="top"> bool Server::UserToPseudo </td>
3141 <td class="md" valign="top">( </td>
3142 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
3143 <td class="mdname" nowrap> <em>user</em>, </td>
3148 <td class="md" nowrap>std::string </td>
3149 <td class="mdname" nowrap> <em>message</em></td>
3153 <td class="md">) </td>
3154 <td class="md" colspan="2"><code> [virtual]</code></td>
3161 <table cellspacing=5 cellpadding=0 border=0>
3169 Remove a user's connection to the irc server, but leave their client in existence in the user hash.
3171 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.
3173 Definition at line <a class="el" href="modules_8cpp-source.html#l00681">681</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
3175 References <a class="el" href="users_8cpp-source.html#l00203">userrec::ClearBuffer()</a>, <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, <a class="el" href="connection_8h-source.html#l00215">connection::fd</a>, <a class="el" href="modules_8h-source.html#l00099">FD_MAGIC_NUMBER</a>, <a class="el" href="connection_8h-source.html#l00219">connection::host</a>, and <a class="el" href="users_8h-source.html#l00125">userrec::ident</a>.
3177 <div class="fragment"><pre>00682 {
3178 00683 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> old_fd = user-><a class="code" href="classconnection.html#o0">fd</a>;
3179 00684 user-><a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="modules_8h.html#a26">FD_MAGIC_NUMBER</a>;
3180 00685 user-><a class="code" href="classuserrec.html#a10">ClearBuffer</a>();
3181 00686 Write(old_fd,<span class="stringliteral">"ERROR :Closing link (%s@%s) [%s]"</span>,user-><a class="code" href="classuserrec.html#o1">ident</a>,user-><a class="code" href="classconnection.html#o1">host</a>,message.c_str());
3182 00687 <span class="preprocessor">#ifdef USE_KQUEUE</span>
3183 00688 <span class="preprocessor"></span> <span class="keyword">struct </span>kevent ke;
3184 00689 EV_SET(&ke, old_fd, EVFILT_READ, EV_DELETE, 0, 0, NULL);
3185 00690 <span class="keywordtype">int</span> i = kevent(kq, &ke, 1, 0, 0, NULL);
3186 00691 <span class="keywordflow">if</span> (i == -1)
3188 00693 log(DEBUG,<span class="stringliteral">"kqueue: Failed to remove user from queue!"</span>);
3190 00695 <span class="preprocessor">#endif</span>
3191 00696 <span class="preprocessor"></span> shutdown(old_fd,2);
3192 00697 close(old_fd);
3197 <hr>The documentation for this class was generated from the following files:<ul>
3198 <li><a class="el" href="modules_8h-source.html">modules.h</a><li><a class="el" href="modules_8cpp-source.html">modules.cpp</a></ul>
3199 <hr size="1"><address style="align: right;"><small>Generated on Thu May 12 22:59:06 2005 for InspIRCd by
3200 <a href="http://www.doxygen.org/index.html">
3201 <img src="doxygen.png" alt="doxygen" align="middle" border=0 >
3202 </a>1.3.3 </small></address>