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.doxygen.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 Inheritance diagram for Server:<p><center><img src="classServer__inherit__graph.gif" border="0" usemap="#Server__inherit__map" alt="Inheritance graph"></center>
14 <map name="Server__inherit__map">
15 <area href="classclassbase.html" shape="rect" coords="8,7,88,34" alt="">
17 <center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for Server:<p><center><img src="classServer__coll__graph.gif" border="0" usemap="#Server__coll__map" alt="Collaboration graph"></center>
18 <map name="Server__coll__map">
19 <area href="classclassbase.html" shape="rect" coords="8,98,88,125" alt="">
21 <center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center><a href="classServer-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
23 <tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
24 <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>
26 <tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. </em> <a href="#a0"></a><em><br><br></td></tr>
27 <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>
29 <tr><td class="mdescLeft"> </td><td class="mdescRight">Default destructor. </em> <a href="#a1"></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#a2">SendOpers</a> (std::string s)</td></tr>
32 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends text to all opers. </em> <a href="#a2"></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#a3">Log</a> (int level, std::string s)</td></tr>
35 <tr><td class="mdescLeft"> </td><td class="mdescRight">Writes a log string. </em> <a href="#a3"></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#a4">Send</a> (int Socket, std::string s)</td></tr>
38 <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>
39 <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>
41 <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>
42 <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>
44 <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>
45 <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>
47 <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>
48 <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>
50 <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>
51 <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>
53 <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>
54 <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>
56 <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>
57 <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>
59 <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>
60 <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>
62 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends a WALLOPS message. </em> <a href="#a12"></a><em><br><br></td></tr>
63 <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>
65 <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>
66 <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>
68 <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>
69 <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>
71 <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>
72 <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>
74 <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>
75 <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>
77 <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>
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#a18">ChanMode</a> (<a class="el" href="classuserrec.html">userrec</a> *User, <a class="el" href="classchanrec.html">chanrec</a> *Chan)</td></tr>
80 <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>
81 <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>
83 <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>
84 <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>
86 <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>
87 <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>
89 <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>
90 <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>
92 <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>
93 <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>
95 <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>
96 <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>
98 <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>
99 <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>
101 <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>
102 <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>
104 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends a servermode. </em> <a href="#a26"></a><em><br><br></td></tr>
105 <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>
107 <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>
108 <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>
110 <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>
111 <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>
113 <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>
114 <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>
116 <tr><td class="mdescLeft"> </td><td class="mdescRight">Forces a user nickchange. </em> <a href="#a30"></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#a31">QuitUser</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string reason)</td></tr>
119 <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>
120 <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>
122 <tr><td class="mdescLeft"> </td><td class="mdescRight">Matches text against a glob pattern. </em> <a href="#a32"></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#a33">CallCommandHandler</a> (std::string commandname, char **parameters, int pcnt, <a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
125 <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>
126 <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>
128 <tr><td class="mdescLeft"> </td><td class="mdescRight">Change displayed hostname of a user. </em> <a href="#a34"></a><em><br><br></td></tr>
129 <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>
131 <tr><td class="mdescLeft"> </td><td class="mdescRight">Change GECOS (fullname) of a user. </em> <a href="#a35"></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#a36">IsUlined</a> (std::string server)</td></tr>
134 <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>
135 <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>
137 <tr><td class="mdescLeft"> </td><td class="mdescRight">Fetches the userlist of a channel. </em> <a href="#a37"></a><em><br><br></td></tr>
138 <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>
140 <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>
141 <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>
143 <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>
144 <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>
146 <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>
147 <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>
149 <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>
150 <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>
152 <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>
153 <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>
155 <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>
156 <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>
158 <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>
159 <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>
161 <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>
162 <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>
164 <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>
165 <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>
167 <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>
168 <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>
170 <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a local K-Line. </em> <a href="#a48"></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#a49">DelELine</a> (std::string hostmask)</td></tr>
173 <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a local E-Line. </em> <a href="#a49"></a><em><br><br></td></tr>
174 <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>
176 <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>
177 <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>
179 <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>
180 <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>
182 <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>
183 <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>
185 <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>
186 <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>
188 <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>
189 <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>
191 <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>
192 <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>
194 <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>
195 <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>
197 <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>
198 <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>
200 <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>
201 <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>
203 <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>
205 <hr><a name="_details"></a><h2>Detailed Description</h2>
206 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.
208 All modules should instantiate at least one copy of this class, and use its member functions to perform their tasks.
212 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>
213 <a name="a0" doxytag="Server::Server"></a><p>
214 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
217 <table cellpadding="0" cellspacing="0" border="0">
219 <td class="md" nowrap valign="top"> Server::Server </td>
220 <td class="md" valign="top">( </td>
221 <td class="mdname1" valign="top" nowrap> </td>
222 <td class="md" valign="top"> ) </td>
223 <td class="md" nowrap></td>
230 <table cellspacing=5 cellpadding=0 border=0>
240 Creates a Server object.
242 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>.
244 <div class="fragment"><pre>00432 {
249 <a name="a1" doxytag="Server::~Server"></a><p>
250 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
253 <table cellpadding="0" cellspacing="0" border="0">
255 <td class="md" nowrap valign="top"> Server::~<a class="el" href="classServer.html">Server</a> </td>
256 <td class="md" valign="top">( </td>
257 <td class="mdname1" valign="top" nowrap> </td>
258 <td class="md" valign="top"> ) </td>
259 <td class="md" nowrap><code> [virtual]</code></td>
266 <table cellspacing=5 cellpadding=0 border=0>
276 Destroys a Server object.
278 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>.
280 <div class="fragment"><pre>00436 {
285 <hr><h2>Member Function Documentation</h2>
286 <a name="a25" doxytag="Server::AddCommand"></a><p>
287 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
290 <table cellpadding="0" cellspacing="0" border="0">
292 <td class="md" nowrap valign="top"> void Server::AddCommand </td>
293 <td class="md" valign="top">( </td>
294 <td class="md" nowrap valign="top">char * </td>
295 <td class="mdname" nowrap> <em>cmd</em>, </td>
300 <td class="md" nowrap>handlerfunc </td>
301 <td class="mdname" nowrap> <em>f</em>, </td>
306 <td class="md" nowrap>char </td>
307 <td class="mdname" nowrap> <em>flags</em>, </td>
312 <td class="md" nowrap>int </td>
313 <td class="mdname" nowrap> <em>minparams</em>, </td>
318 <td class="md" nowrap>char * </td>
319 <td class="mdname" nowrap> <em>source</em></td>
323 <td class="md">) </td>
324 <td class="md" colspan="2"><code> [virtual]</code></td>
331 <table cellspacing=5 cellpadding=0 border=0>
339 Adds a command to the command table.
341 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>
342 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>
343 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.
345 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>.
347 References <a class="el" href="modules_8h.html#a35">createcommand()</a>.
349 <div class="fragment"><pre>00505 {
350 00506 <a class="code" href="modules_8h.html#a35">createcommand</a>(cmd,f,flags,minparams,source);
355 <a name="a44" doxytag="Server::AddELine"></a><p>
356 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
359 <table cellpadding="0" cellspacing="0" border="0">
361 <td class="md" nowrap valign="top"> void Server::AddELine </td>
362 <td class="md" valign="top">( </td>
363 <td class="md" nowrap valign="top">long </td>
364 <td class="mdname" nowrap> <em>duration</em>, </td>
369 <td class="md" nowrap>std::string </td>
370 <td class="mdname" nowrap> <em>source</em>, </td>
375 <td class="md" nowrap>std::string </td>
376 <td class="mdname" nowrap> <em>reason</em>, </td>
381 <td class="md" nowrap>std::string </td>
382 <td class="mdname" nowrap> <em>hostmask</em></td>
386 <td class="md">) </td>
387 <td class="md" colspan="2"><code> [virtual]</code></td>
394 <table cellspacing=5 cellpadding=0 border=0>
402 Adds a E-line The E-line is enforced as soon as it is added.
404 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.
406 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>.
408 References <a class="el" href="xline_8h.html#a5">add_eline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
410 <div class="fragment"><pre>00751 {
411 00752 <a class="code" href="xline_8h.html#a5">add_eline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
416 <a name="a24" doxytag="Server::AddExtendedListMode"></a><p>
417 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
420 <table cellpadding="0" cellspacing="0" border="0">
422 <td class="md" nowrap valign="top"> bool Server::AddExtendedListMode </td>
423 <td class="md" valign="top">( </td>
424 <td class="md" nowrap valign="top">char </td>
425 <td class="mdname1" valign="top" nowrap> <em>modechar</em> </td>
426 <td class="md" valign="top"> ) </td>
427 <td class="md" nowrap><code> [virtual]</code></td>
434 <table cellspacing=5 cellpadding=0 border=0>
442 Adds an extended mode letter which is parsed by a module and handled in a list fashion.
444 This call is used to implement modes like +q and +a. The characteristics of these modes are as follows:<p>
445 (1) They are ALWAYS on channels, not on users, therefore their type is MT_CHANNEL<p>
446 (2) They always take exactly one parameter when being added or removed<p>
447 (3) They can be set multiple times, usually on users in channels<p>
448 (4) The mode and its parameter are NOT stored in the channels modes structure<p>
449 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.
451 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>.
453 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>.
455 <div class="fragment"><pre>00668 {
456 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);
457 00670 <span class="keywordflow">if</span> (res)
458 00671 <a class="code" href="modules_8cpp.html#a60">ModeMakeList</a>(modechar);
459 00672 <span class="keywordflow">return</span> res;
464 <a name="a23" doxytag="Server::AddExtendedMode"></a><p>
465 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
468 <table cellpadding="0" cellspacing="0" border="0">
470 <td class="md" nowrap valign="top"> bool Server::AddExtendedMode </td>
471 <td class="md" valign="top">( </td>
472 <td class="md" nowrap valign="top">char </td>
473 <td class="mdname" nowrap> <em>modechar</em>, </td>
478 <td class="md" nowrap>int </td>
479 <td class="mdname" nowrap> <em>type</em>, </td>
484 <td class="md" nowrap>bool </td>
485 <td class="mdname" nowrap> <em>requires_oper</em>, </td>
490 <td class="md" nowrap>int </td>
491 <td class="mdname" nowrap> <em>params_when_on</em>, </td>
496 <td class="md" nowrap>int </td>
497 <td class="mdname" nowrap> <em>params_when_off</em></td>
501 <td class="md">) </td>
502 <td class="md" colspan="2"><code> [virtual]</code></td>
509 <table cellspacing=5 cellpadding=0 border=0>
517 Adds an extended mode letter which is parsed by a module.
519 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.
521 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>.
523 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>.
525 <div class="fragment"><pre>00640 {
526 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>)))
528 00643 <span class="keywordflow">if</span> (type == <a class="code" href="modules_8h.html#a7">MT_SERVER</a>)
530 00645 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion"</span>);
531 00646 <span class="keywordflow">return</span> <span class="keyword">false</span>;
533 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>))
535 00650 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Parameters on MT_CLIENT modes are not supported"</span>);
536 00651 <span class="keywordflow">return</span> <span class="keyword">false</span>;
538 00653 <span class="keywordflow">if</span> ((params_when_on>1) || (params_when_off>1))
540 00655 log(DEBUG,<span class="stringliteral">"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported"</span>);
541 00656 <span class="keywordflow">return</span> <span class="keyword">false</span>;
543 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);
545 00660 <span class="keywordflow">else</span>
547 00662 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Muppet modechar detected."</span>);
549 00664 <span class="keywordflow">return</span> <span class="keyword">false</span>;
554 <a name="a40" doxytag="Server::AddGLine"></a><p>
555 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
558 <table cellpadding="0" cellspacing="0" border="0">
560 <td class="md" nowrap valign="top"> void Server::AddGLine </td>
561 <td class="md" valign="top">( </td>
562 <td class="md" nowrap valign="top">long </td>
563 <td class="mdname" nowrap> <em>duration</em>, </td>
568 <td class="md" nowrap>std::string </td>
569 <td class="mdname" nowrap> <em>source</em>, </td>
574 <td class="md" nowrap>std::string </td>
575 <td class="mdname" nowrap> <em>reason</em>, </td>
580 <td class="md" nowrap>std::string </td>
581 <td class="mdname" nowrap> <em>hostmask</em></td>
585 <td class="md">) </td>
586 <td class="md" colspan="2"><code> [virtual]</code></td>
593 <table cellspacing=5 cellpadding=0 border=0>
601 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.
603 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.
605 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>.
607 References <a class="el" href="xline_8h.html#a1">add_gline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
609 <div class="fragment"><pre>00731 {
610 00732 <a class="code" href="xline_8h.html#a1">add_gline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
615 <a name="a43" doxytag="Server::AddKLine"></a><p>
616 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
619 <table cellpadding="0" cellspacing="0" border="0">
621 <td class="md" nowrap valign="top"> void Server::AddKLine </td>
622 <td class="md" valign="top">( </td>
623 <td class="md" nowrap valign="top">long </td>
624 <td class="mdname" nowrap> <em>duration</em>, </td>
629 <td class="md" nowrap>std::string </td>
630 <td class="mdname" nowrap> <em>source</em>, </td>
635 <td class="md" nowrap>std::string </td>
636 <td class="mdname" nowrap> <em>reason</em>, </td>
641 <td class="md" nowrap>std::string </td>
642 <td class="mdname" nowrap> <em>hostmask</em></td>
646 <td class="md">) </td>
647 <td class="md" colspan="2"><code> [virtual]</code></td>
654 <table cellspacing=5 cellpadding=0 border=0>
662 Adds a K-line The K-line is enforced as soon as it is added.
664 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.
666 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>.
668 References <a class="el" href="xline_8h.html#a4">add_kline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
670 <div class="fragment"><pre>00746 {
671 00747 <a class="code" href="xline_8h.html#a4">add_kline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
676 <a name="a41" doxytag="Server::AddQLine"></a><p>
677 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
680 <table cellpadding="0" cellspacing="0" border="0">
682 <td class="md" nowrap valign="top"> void Server::AddQLine </td>
683 <td class="md" valign="top">( </td>
684 <td class="md" nowrap valign="top">long </td>
685 <td class="mdname" nowrap> <em>duration</em>, </td>
690 <td class="md" nowrap>std::string </td>
691 <td class="mdname" nowrap> <em>source</em>, </td>
696 <td class="md" nowrap>std::string </td>
697 <td class="mdname" nowrap> <em>reason</em>, </td>
702 <td class="md" nowrap>std::string </td>
703 <td class="mdname" nowrap> <em>nickname</em></td>
707 <td class="md">) </td>
708 <td class="md" colspan="2"><code> [virtual]</code></td>
715 <table cellspacing=5 cellpadding=0 border=0>
723 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.
725 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.
727 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>.
729 References <a class="el" href="xline_8h.html#a2">add_qline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
731 <div class="fragment"><pre>00736 {
732 00737 <a class="code" href="xline_8h.html#a2">add_qline</a>(duration, source.c_str(), reason.c_str(), nickname.c_str());
737 <a name="a42" doxytag="Server::AddZLine"></a><p>
738 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
741 <table cellpadding="0" cellspacing="0" border="0">
743 <td class="md" nowrap valign="top"> void Server::AddZLine </td>
744 <td class="md" valign="top">( </td>
745 <td class="md" nowrap valign="top">long </td>
746 <td class="mdname" nowrap> <em>duration</em>, </td>
751 <td class="md" nowrap>std::string </td>
752 <td class="mdname" nowrap> <em>source</em>, </td>
757 <td class="md" nowrap>std::string </td>
758 <td class="mdname" nowrap> <em>reason</em>, </td>
763 <td class="md" nowrap>std::string </td>
764 <td class="mdname" nowrap> <em>ipaddr</em></td>
768 <td class="md">) </td>
769 <td class="md" colspan="2"><code> [virtual]</code></td>
776 <table cellspacing=5 cellpadding=0 border=0>
784 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.
786 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.
788 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>.
790 References <a class="el" href="xline_8h.html#a3">add_zline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
792 <div class="fragment"><pre>00741 {
793 00742 <a class="code" href="xline_8h.html#a3">add_zline</a>(duration, source.c_str(), reason.c_str(), ipaddr.c_str());
798 <a name="a50" doxytag="Server::CalcDuration"></a><p>
799 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
802 <table cellpadding="0" cellspacing="0" border="0">
804 <td class="md" nowrap valign="top"> long Server::CalcDuration </td>
805 <td class="md" valign="top">( </td>
806 <td class="md" nowrap valign="top">std::string </td>
807 <td class="mdname1" valign="top" nowrap> <em>duration</em> </td>
808 <td class="md" valign="top"> ) </td>
809 <td class="md" nowrap><code> [virtual]</code></td>
816 <table cellspacing=5 cellpadding=0 border=0>
824 Calculates a duration This method will take a string containing a formatted duration (e.g.
826 "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.
828 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>.
830 References <a class="el" href="commands_8h.html#a75">duration()</a>.
832 <div class="fragment"><pre>00781 {
833 00782 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a75">duration</a>(delta.c_str());
838 <a name="a33" doxytag="Server::CallCommandHandler"></a><p>
839 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
842 <table cellpadding="0" cellspacing="0" border="0">
844 <td class="md" nowrap valign="top"> void Server::CallCommandHandler </td>
845 <td class="md" valign="top">( </td>
846 <td class="md" nowrap valign="top">std::string </td>
847 <td class="mdname" nowrap> <em>commandname</em>, </td>
852 <td class="md" nowrap>char ** </td>
853 <td class="mdname" nowrap> <em>parameters</em>, </td>
858 <td class="md" nowrap>int </td>
859 <td class="mdname" nowrap> <em>pcnt</em>, </td>
864 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
865 <td class="mdname" nowrap> <em>user</em></td>
869 <td class="md">) </td>
870 <td class="md" colspan="2"><code> [virtual]</code></td>
877 <table cellspacing=5 cellpadding=0 border=0>
885 Calls the handler for a command, either implemented by the core or by another module.
887 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>
888 ) 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.
890 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>.
892 <div class="fragment"><pre>00495 {
893 00496 call_handler(commandname.c_str(),parameters,pcnt,user);
898 <a name="a35" doxytag="Server::ChangeGECOS"></a><p>
899 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
902 <table cellpadding="0" cellspacing="0" border="0">
904 <td class="md" nowrap valign="top"> void Server::ChangeGECOS </td>
905 <td class="md" valign="top">( </td>
906 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
907 <td class="mdname" nowrap> <em>user</em>, </td>
912 <td class="md" nowrap>std::string </td>
913 <td class="mdname" nowrap> <em>gecos</em></td>
917 <td class="md">) </td>
918 <td class="md" colspan="2"><code> [virtual]</code></td>
925 <table cellspacing=5 cellpadding=0 border=0>
933 Change GECOS (fullname) of a user.
935 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.
937 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>.
939 References <a class="el" href="message_8h.html#a10">ChangeName()</a>.
941 <div class="fragment"><pre>00588 {
942 00589 <a class="code" href="message_8h.html#a10">ChangeName</a>(user,gecos.c_str());
947 <a name="a34" doxytag="Server::ChangeHost"></a><p>
948 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
951 <table cellpadding="0" cellspacing="0" border="0">
953 <td class="md" nowrap valign="top"> void Server::ChangeHost </td>
954 <td class="md" valign="top">( </td>
955 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
956 <td class="mdname" nowrap> <em>user</em>, </td>
961 <td class="md" nowrap>std::string </td>
962 <td class="mdname" nowrap> <em>host</em></td>
966 <td class="md">) </td>
967 <td class="md" colspan="2"><code> [virtual]</code></td>
974 <table cellspacing=5 cellpadding=0 border=0>
982 Change displayed hostname of a user.
984 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.
986 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>.
988 References <a class="el" href="message_8h.html#a11">ChangeDisplayedHost()</a>.
990 <div class="fragment"><pre>00583 {
991 00584 <a class="code" href="message_8h.html#a11">ChangeDisplayedHost</a>(user,host.c_str());
996 <a name="a30" doxytag="Server::ChangeUserNick"></a><p>
997 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1000 <table cellpadding="0" cellspacing="0" border="0">
1002 <td class="md" nowrap valign="top"> void Server::ChangeUserNick </td>
1003 <td class="md" valign="top">( </td>
1004 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1005 <td class="mdname" nowrap> <em>user</em>, </td>
1010 <td class="md" nowrap>std::string </td>
1011 <td class="mdname" nowrap> <em>nickname</em></td>
1015 <td class="md">) </td>
1016 <td class="md" colspan="2"><code> [virtual]</code></td>
1023 <table cellspacing=5 cellpadding=0 border=0>
1031 Forces a user nickchange.
1033 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.
1035 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>.
1037 <div class="fragment"><pre>00480 {
1038 00481 force_nickchange(user,nickname.c_str());
1043 <a name="a18" doxytag="Server::ChanMode"></a><p>
1044 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1047 <table cellpadding="0" cellspacing="0" border="0">
1049 <td class="md" nowrap valign="top"> std::string Server::ChanMode </td>
1050 <td class="md" valign="top">( </td>
1051 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1052 <td class="mdname" nowrap> <em>User</em>, </td>
1057 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
1058 <td class="mdname" nowrap> <em>Chan</em></td>
1062 <td class="md">) </td>
1063 <td class="md" colspan="2"><code> [virtual]</code></td>
1070 <table cellspacing=5 cellpadding=0 border=0>
1078 Attempts to look up a user's privilages on a channel.
1080 This function will return a string containing either @, , +, or an empty string, representing the user's privilages upon the channel you specify.
1082 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>.
1084 References <a class="el" href="message_8h.html#a14">cmode()</a>.
1086 <div class="fragment"><pre>00613 {
1087 00614 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a14">cmode</a>(User,Chan);
1092 <a name="a10" doxytag="Server::CommonChannels"></a><p>
1093 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1096 <table cellpadding="0" cellspacing="0" border="0">
1098 <td class="md" nowrap valign="top"> bool Server::CommonChannels </td>
1099 <td class="md" valign="top">( </td>
1100 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1101 <td class="mdname" nowrap> <em>u1</em>, </td>
1106 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
1107 <td class="mdname" nowrap> <em>u2</em></td>
1111 <td class="md">) </td>
1112 <td class="md" colspan="2"><code> [virtual]</code></td>
1119 <table cellspacing=5 cellpadding=0 border=0>
1127 Returns true if two users share a common channel.
1129 This method is used internally by the NICK and QUIT commands, and the <a class="el" href="classServer.html#a11">Server::SendCommon</a> method.
1131 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>.
1133 References <a class="el" href="message_8h.html#a0">common_channels()</a>.
1135 <div class="fragment"><pre>00561 {
1136 00562 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a0">common_channels</a>(u1,u2) != 0);
1141 <a name="a14" doxytag="Server::CountUsers"></a><p>
1142 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1145 <table cellpadding="0" cellspacing="0" border="0">
1147 <td class="md" nowrap valign="top"> int Server::CountUsers </td>
1148 <td class="md" valign="top">( </td>
1149 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
1150 <td class="mdname1" valign="top" nowrap> <em>c</em> </td>
1151 <td class="md" valign="top"> ) </td>
1152 <td class="md" nowrap><code> [virtual]</code></td>
1159 <table cellspacing=5 cellpadding=0 border=0>
1167 Returns a count of the number of users on a channel.
1169 This will NEVER be 0, as if the chanrec exists, it will have at least one user in the channel.
1171 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>.
1173 <div class="fragment"><pre>00676 {
1174 00677 <span class="keywordflow">return</span> usercount(c);
1179 <a name="a49" doxytag="Server::DelELine"></a><p>
1180 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1183 <table cellpadding="0" cellspacing="0" border="0">
1185 <td class="md" nowrap valign="top"> bool Server::DelELine </td>
1186 <td class="md" valign="top">( </td>
1187 <td class="md" nowrap valign="top">std::string </td>
1188 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1189 <td class="md" valign="top"> ) </td>
1190 <td class="md" nowrap><code> [virtual]</code></td>
1197 <table cellspacing=5 cellpadding=0 border=0>
1205 Deletes a local E-Line.
1209 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>.
1211 References <a class="el" href="xline_8h.html#a10">del_eline()</a>.
1213 <div class="fragment"><pre>00776 {
1214 00777 <a class="code" href="xline_8h.html#a10">del_eline</a>(hostmask.c_str());
1219 <a name="a45" doxytag="Server::DelGLine"></a><p>
1220 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1223 <table cellpadding="0" cellspacing="0" border="0">
1225 <td class="md" nowrap valign="top"> bool Server::DelGLine </td>
1226 <td class="md" valign="top">( </td>
1227 <td class="md" nowrap valign="top">std::string </td>
1228 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1229 <td class="md" valign="top"> ) </td>
1230 <td class="md" nowrap><code> [virtual]</code></td>
1237 <table cellspacing=5 cellpadding=0 border=0>
1245 Deletes a G-Line from all servers on the mesh.
1249 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>.
1251 References <a class="el" href="xline_8h.html#a6">del_gline()</a>.
1253 <div class="fragment"><pre>00756 {
1254 00757 <a class="code" href="xline_8h.html#a6">del_gline</a>(hostmask.c_str());
1259 <a name="a48" doxytag="Server::DelKLine"></a><p>
1260 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1263 <table cellpadding="0" cellspacing="0" border="0">
1265 <td class="md" nowrap valign="top"> bool Server::DelKLine </td>
1266 <td class="md" valign="top">( </td>
1267 <td class="md" nowrap valign="top">std::string </td>
1268 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1269 <td class="md" valign="top"> ) </td>
1270 <td class="md" nowrap><code> [virtual]</code></td>
1277 <table cellspacing=5 cellpadding=0 border=0>
1285 Deletes a local K-Line.
1289 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>.
1291 References <a class="el" href="xline_8h.html#a9">del_kline()</a>.
1293 <div class="fragment"><pre>00771 {
1294 00772 <a class="code" href="xline_8h.html#a9">del_kline</a>(hostmask.c_str());
1299 <a name="a46" doxytag="Server::DelQLine"></a><p>
1300 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1303 <table cellpadding="0" cellspacing="0" border="0">
1305 <td class="md" nowrap valign="top"> bool Server::DelQLine </td>
1306 <td class="md" valign="top">( </td>
1307 <td class="md" nowrap valign="top">std::string </td>
1308 <td class="mdname1" valign="top" nowrap> <em>nickname</em> </td>
1309 <td class="md" valign="top"> ) </td>
1310 <td class="md" nowrap><code> [virtual]</code></td>
1317 <table cellspacing=5 cellpadding=0 border=0>
1325 Deletes a Q-Line from all servers on the mesh.
1329 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>.
1331 References <a class="el" href="xline_8h.html#a7">del_qline()</a>.
1333 <div class="fragment"><pre>00761 {
1334 00762 <a class="code" href="xline_8h.html#a7">del_qline</a>(nickname.c_str());
1339 <a name="a47" doxytag="Server::DelZLine"></a><p>
1340 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1343 <table cellpadding="0" cellspacing="0" border="0">
1345 <td class="md" nowrap valign="top"> bool Server::DelZLine </td>
1346 <td class="md" valign="top">( </td>
1347 <td class="md" nowrap valign="top">std::string </td>
1348 <td class="mdname1" valign="top" nowrap> <em>ipaddr</em> </td>
1349 <td class="md" valign="top"> ) </td>
1350 <td class="md" nowrap><code> [virtual]</code></td>
1357 <table cellspacing=5 cellpadding=0 border=0>
1365 Deletes a Z-Line from all servers on the mesh.
1369 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>.
1371 References <a class="el" href="xline_8h.html#a8">del_zline()</a>.
1373 <div class="fragment"><pre>00766 {
1374 00767 <a class="code" href="xline_8h.html#a8">del_zline</a>(ipaddr.c_str());
1379 <a name="a17" doxytag="Server::FindChannel"></a><p>
1380 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1383 <table cellpadding="0" cellspacing="0" border="0">
1385 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::FindChannel </td>
1386 <td class="md" valign="top">( </td>
1387 <td class="md" nowrap valign="top">std::string </td>
1388 <td class="mdname1" valign="top" nowrap> <em>channel</em> </td>
1389 <td class="md" valign="top"> ) </td>
1390 <td class="md" nowrap><code> [virtual]</code></td>
1397 <table cellspacing=5 cellpadding=0 border=0>
1405 Attempts to look up a channel and return a pointer to it.
1407 This function will return NULL if the channel does not exist.
1409 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>.
1411 <div class="fragment"><pre>00608 {
1412 00609 <span class="keywordflow">return</span> FindChan(channel.c_str());
1417 <a name="a16" doxytag="Server::FindDescriptor"></a><p>
1418 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1421 <table cellpadding="0" cellspacing="0" border="0">
1423 <td class="md" nowrap valign="top"> <a class="el" href="classuserrec.html">userrec</a> * Server::FindDescriptor </td>
1424 <td class="md" valign="top">( </td>
1425 <td class="md" nowrap valign="top">int </td>
1426 <td class="mdname1" valign="top" nowrap> <em>socket</em> </td>
1427 <td class="md" valign="top"> ) </td>
1428 <td class="md" nowrap><code> [virtual]</code></td>
1435 <table cellspacing=5 cellpadding=0 border=0>
1443 Attempts to look up a nick using the file descriptor associated with that nick.
1445 This function will return NULL if the file descriptor is not associated with a valid user.
1447 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>.
1449 References <a class="el" href="modules_8cpp-source.html#l00119">fd_ref_table</a>.
1451 <div class="fragment"><pre>00603 {
1452 00604 <span class="keywordflow">return</span> (socket < 65536 ? <a class="code" href="modules_8cpp.html#a38">fd_ref_table</a>[socket] : NULL);
1457 <a name="a59" doxytag="Server::FindModule"></a><p>
1458 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1461 <table cellpadding="0" cellspacing="0" border="0">
1463 <td class="md" nowrap valign="top"> <a class="el" href="classModule.html">Module</a> * Server::FindModule </td>
1464 <td class="md" valign="top">( </td>
1465 <td class="md" nowrap valign="top">std::string </td>
1466 <td class="mdname1" valign="top" nowrap> <em>name</em> </td>
1467 <td class="md" valign="top"> ) </td>
1468 <td class="md" nowrap><code> [virtual]</code></td>
1475 <table cellspacing=5 cellpadding=0 border=0>
1483 This function finds a module by name.
1485 You must provide the filename of the module. If the module cannot be found (is not loaded) the function will return NULL.
1487 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>.
1489 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>.
1491 <div class="fragment"><pre>00859 {
1492 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++)
1494 00862 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#a27">module_names</a>[i] == name)
1496 00864 <span class="keywordflow">return</span> <a class="code" href="channels_8cpp.html#a2">modules</a>[i];
1499 00867 <span class="keywordflow">return</span> NULL;
1504 <a name="a15" doxytag="Server::FindNick"></a><p>
1505 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1508 <table cellpadding="0" cellspacing="0" border="0">
1510 <td class="md" nowrap valign="top"> <a class="el" href="classuserrec.html">userrec</a> * Server::FindNick </td>
1511 <td class="md" valign="top">( </td>
1512 <td class="md" nowrap valign="top">std::string </td>
1513 <td class="mdname1" valign="top" nowrap> <em>nick</em> </td>
1514 <td class="md" valign="top"> ) </td>
1515 <td class="md" nowrap><code> [virtual]</code></td>
1522 <table cellspacing=5 cellpadding=0 border=0>
1530 Attempts to look up a nick and return a pointer to it.
1532 This function will return NULL if the nick does not exist.
1534 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>.
1536 <div class="fragment"><pre>00598 {
1537 00599 <span class="keywordflow">return</span> Find(nick);
1542 <a name="a22" doxytag="Server::GetAdmin"></a><p>
1543 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1546 <table cellpadding="0" cellspacing="0" border="0">
1548 <td class="md" nowrap valign="top"> <a class="el" href="classAdmin.html">Admin</a> Server::GetAdmin </td>
1549 <td class="md" valign="top">( </td>
1550 <td class="mdname1" valign="top" nowrap> </td>
1551 <td class="md" valign="top"> ) </td>
1552 <td class="md" nowrap><code> [virtual]</code></td>
1559 <table cellspacing=5 cellpadding=0 border=0>
1567 Returns the information of the server as returned by the /ADMIN command.
1569 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.
1571 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>.
1573 <div class="fragment"><pre>00633 {
1574 00634 <span class="keywordflow">return</span> <a class="code" href="classAdmin.html">Admin</a>(getadminname(),getadminemail(),getadminnick());
1579 <a name="a21" doxytag="Server::GetNetworkName"></a><p>
1580 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1583 <table cellpadding="0" cellspacing="0" border="0">
1585 <td class="md" nowrap valign="top"> std::string Server::GetNetworkName </td>
1586 <td class="md" valign="top">( </td>
1587 <td class="mdname1" valign="top" nowrap> </td>
1588 <td class="md" valign="top"> ) </td>
1589 <td class="md" nowrap><code> [virtual]</code></td>
1596 <table cellspacing=5 cellpadding=0 border=0>
1604 Returns the network name, global to all linked servers.
1608 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>.
1610 <div class="fragment"><pre>00628 {
1611 00629 <span class="keywordflow">return</span> getnetworkname();
1616 <a name="a20" doxytag="Server::GetServerName"></a><p>
1617 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1620 <table cellpadding="0" cellspacing="0" border="0">
1622 <td class="md" nowrap valign="top"> std::string Server::GetServerName </td>
1623 <td class="md" valign="top">( </td>
1624 <td class="mdname1" valign="top" nowrap> </td>
1625 <td class="md" valign="top"> ) </td>
1626 <td class="md" nowrap><code> [virtual]</code></td>
1633 <table cellspacing=5 cellpadding=0 border=0>
1641 Returns the server name of the server where the module is loaded.
1645 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>.
1647 <div class="fragment"><pre>00623 {
1648 00624 <span class="keywordflow">return</span> getservername();
1653 <a name="a37" doxytag="Server::GetUsers"></a><p>
1654 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1657 <table cellpadding="0" cellspacing="0" border="0">
1659 <td class="md" nowrap valign="top"> <a class="el" href="modules_8h.html#a33">chanuserlist</a> Server::GetUsers </td>
1660 <td class="md" valign="top">( </td>
1661 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
1662 <td class="mdname1" valign="top" nowrap> <em>chan</em> </td>
1663 <td class="md" valign="top"> ) </td>
1664 <td class="md" nowrap><code> [virtual]</code></td>
1671 <table cellspacing=5 cellpadding=0 border=0>
1679 Fetches the userlist of a channel.
1681 This function must be here and not a member of userrec or chanrec due to include constraints.
1683 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>.
1685 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>.
1687 <div class="fragment"><pre>00468 {
1688 00469 <a class="code" href="modules_8h.html#a33">chanuserlist</a> userl;
1689 00470 userl.clear();
1690 00471 std::vector<char*> *<a class="code" href="channels_8cpp.html#a15">list</a> = chan-><a class="code" href="classchanrec.html#a7">GetUsers</a>();
1691 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++)
1693 00474 <span class="keywordtype">char</span>* o = *i;
1694 00475 userl.push_back((<a class="code" href="classuserrec.html">userrec</a>*)o);
1696 00477 <span class="keywordflow">return</span> userl;
1701 <a name="a13" doxytag="Server::IsNick"></a><p>
1702 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1705 <table cellpadding="0" cellspacing="0" border="0">
1707 <td class="md" nowrap valign="top"> bool Server::IsNick </td>
1708 <td class="md" valign="top">( </td>
1709 <td class="md" nowrap valign="top">std::string </td>
1710 <td class="mdname1" valign="top" nowrap> <em>nick</em> </td>
1711 <td class="md" valign="top"> ) </td>
1712 <td class="md" nowrap><code> [virtual]</code></td>
1719 <table cellspacing=5 cellpadding=0 border=0>
1727 Returns true if a nick is valid.
1729 Nicks for unregistered connections will return false.
1731 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>.
1733 References <a class="el" href="message_8h.html#a13">isnick()</a>.
1735 <div class="fragment"><pre>00593 {
1736 00594 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a13">isnick</a>(nick.c_str()) != 0);
1741 <a name="a19" doxytag="Server::IsOnChannel"></a><p>
1742 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1745 <table cellpadding="0" cellspacing="0" border="0">
1747 <td class="md" nowrap valign="top"> bool Server::IsOnChannel </td>
1748 <td class="md" valign="top">( </td>
1749 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1750 <td class="mdname" nowrap> <em>User</em>, </td>
1755 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
1756 <td class="mdname" nowrap> <em>Chan</em></td>
1760 <td class="md">) </td>
1761 <td class="md" colspan="2"><code> [virtual]</code></td>
1768 <table cellspacing=5 cellpadding=0 border=0>
1776 Checks if a user is on a channel.
1778 This function will return true or false to indicate if user 'User' is on channel 'Chan'.
1780 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>.
1782 References <a class="el" href="message_8h.html#a16">has_channel()</a>.
1784 <div class="fragment"><pre>00618 {
1785 00619 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a16">has_channel</a>(User,Chan);
1790 <a name="a36" doxytag="Server::IsUlined"></a><p>
1791 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1794 <table cellpadding="0" cellspacing="0" border="0">
1796 <td class="md" nowrap valign="top"> bool Server::IsUlined </td>
1797 <td class="md" valign="top">( </td>
1798 <td class="md" nowrap valign="top">std::string </td>
1799 <td class="mdname1" valign="top" nowrap> <em>server</em> </td>
1800 <td class="md" valign="top"> ) </td>
1801 <td class="md" nowrap><code> [virtual]</code></td>
1808 <table cellspacing=5 cellpadding=0 border=0>
1816 Returns true if the servername you give is ulined.
1818 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.
1820 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>.
1822 References <a class="el" href="commands_8h.html#a74">is_uline()</a>.
1824 <div class="fragment"><pre>00490 {
1825 00491 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a74">is_uline</a>(server.c_str());
1830 <a name="a51" doxytag="Server::IsValidMask"></a><p>
1831 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1834 <table cellpadding="0" cellspacing="0" border="0">
1836 <td class="md" nowrap valign="top"> bool Server::IsValidMask </td>
1837 <td class="md" valign="top">( </td>
1838 <td class="md" nowrap valign="top">std::string </td>
1839 <td class="mdname1" valign="top" nowrap> <em>mask</em> </td>
1840 <td class="md" valign="top"> ) </td>
1841 <td class="md" nowrap><code> [virtual]</code></td>
1848 <table cellspacing=5 cellpadding=0 border=0>
1856 Returns true if a nick!ident string is correctly formatted, false if otherwise.
1860 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>.
1862 <div class="fragment"><pre>00786 {
1863 00787 <span class="keyword">const</span> <span class="keywordtype">char</span>* dest = mask.c_str();
1864 00788 <span class="keywordflow">if</span> (strchr(dest,<span class="charliteral">'!'</span>)==0)
1865 00789 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1866 00790 <span class="keywordflow">if</span> (strchr(dest,<span class="charliteral">'@'</span>)==0)
1867 00791 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1868 00792 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1869 00793 <span class="keywordflow">if</span> (dest[i] < 32)
1870 00794 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1871 00795 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1872 00796 <span class="keywordflow">if</span> (dest[i] > 126)
1873 00797 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1874 00798 <span class="keywordtype">int</span> c = 0;
1875 00799 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1876 00800 <span class="keywordflow">if</span> (dest[i] == <span class="charliteral">'!'</span>)
1878 00802 <span class="keywordflow">if</span> (c>1)
1879 00803 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1881 00805 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1882 00806 <span class="keywordflow">if</span> (dest[i] == <span class="charliteral">'@'</span>)
1884 00808 <span class="keywordflow">if</span> (c>1)
1885 00809 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1887 00811 <span class="keywordflow">return</span> <span class="keyword">true</span>;
1892 <a name="a28" doxytag="Server::JoinUserToChannel"></a><p>
1893 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1896 <table cellpadding="0" cellspacing="0" border="0">
1898 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::JoinUserToChannel </td>
1899 <td class="md" valign="top">( </td>
1900 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1901 <td class="mdname" nowrap> <em>user</em>, </td>
1906 <td class="md" nowrap>std::string </td>
1907 <td class="mdname" nowrap> <em>cname</em>, </td>
1912 <td class="md" nowrap>std::string </td>
1913 <td class="mdname" nowrap> <em>key</em></td>
1917 <td class="md">) </td>
1918 <td class="md" colspan="2"><code> [virtual]</code></td>
1925 <table cellspacing=5 cellpadding=0 border=0>
1933 Forces a user to join a channel.
1935 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.
1937 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>.
1939 <div class="fragment"><pre>00458 {
1940 00459 <span class="keywordflow">return</span> add_channel(user,cname.c_str(),key.c_str(),<span class="keyword">false</span>);
1945 <a name="a3" doxytag="Server::Log"></a><p>
1946 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1949 <table cellpadding="0" cellspacing="0" border="0">
1951 <td class="md" nowrap valign="top"> void Server::Log </td>
1952 <td class="md" valign="top">( </td>
1953 <td class="md" nowrap valign="top">int </td>
1954 <td class="mdname" nowrap> <em>level</em>, </td>
1959 <td class="md" nowrap>std::string </td>
1960 <td class="mdname" nowrap> <em>s</em></td>
1964 <td class="md">) </td>
1965 <td class="md" colspan="2"><code> [virtual]</code></td>
1972 <table cellspacing=5 cellpadding=0 border=0>
1980 Writes a log string.
1982 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.
1984 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>.
1986 <div class="fragment"><pre>00500 {
1987 00501 log(level,<span class="stringliteral">"%s"</span>,s.c_str());
1992 <a name="a32" doxytag="Server::MatchText"></a><p>
1993 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1996 <table cellpadding="0" cellspacing="0" border="0">
1998 <td class="md" nowrap valign="top"> bool Server::MatchText </td>
1999 <td class="md" valign="top">( </td>
2000 <td class="md" nowrap valign="top">std::string </td>
2001 <td class="mdname" nowrap> <em>sliteral</em>, </td>
2006 <td class="md" nowrap>std::string </td>
2007 <td class="mdname" nowrap> <em>spattern</em></td>
2011 <td class="md">) </td>
2012 <td class="md" colspan="2"><code> [virtual]</code></td>
2019 <table cellspacing=5 cellpadding=0 border=0>
2027 Matches text against a glob pattern.
2029 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.
2031 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>.
2033 <div class="fragment"><pre>00445 {
2034 00446 <span class="keywordtype">char</span> literal[MAXBUF],pattern[MAXBUF];
2035 00447 strlcpy(literal,sliteral.c_str(),MAXBUF);
2036 00448 strlcpy(pattern,spattern.c_str(),MAXBUF);
2037 00449 <span class="keywordflow">return</span> match(literal,pattern);
2042 <a name="a57" doxytag="Server::MeshCheckChan"></a><p>
2043 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2046 <table cellpadding="0" cellspacing="0" border="0">
2048 <td class="md" nowrap valign="top"> bool Server::MeshCheckChan </td>
2049 <td class="md" valign="top">( </td>
2050 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
2051 <td class="mdname" nowrap> <em>c</em>, </td>
2056 <td class="md" nowrap>std::string </td>
2057 <td class="mdname" nowrap> <em>servername</em></td>
2061 <td class="md">) </td>
2062 <td class="md" colspan="2"><code> [virtual]</code></td>
2069 <table cellspacing=5 cellpadding=0 border=0>
2077 This function is used to check if any users on channel c are on server servername.
2079 This is used internally by PRIVMSG etc. You should not need to use it.
2081 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>.
2083 <div class="fragment"><pre>00841 {
2084 00842 <span class="keywordflow">if</span> (c)
2086 00844 <span class="keywordflow">return</span> ChanAnyOnThisServer(c,(<span class="keywordtype">char</span>*)servername.c_str());
2088 00846 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;
2093 <a name="a58" doxytag="Server::MeshCheckCommon"></a><p>
2094 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2097 <table cellpadding="0" cellspacing="0" border="0">
2099 <td class="md" nowrap valign="top"> bool Server::MeshCheckCommon </td>
2100 <td class="md" valign="top">( </td>
2101 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2102 <td class="mdname" nowrap> <em>u</em>, </td>
2107 <td class="md" nowrap>std::string </td>
2108 <td class="mdname" nowrap> <em>servername</em></td>
2112 <td class="md">) </td>
2113 <td class="md" colspan="2"><code> [virtual]</code></td>
2120 <table cellspacing=5 cellpadding=0 border=0>
2128 This function is used to check if user u has any channels in common with users on servername.
2130 This is used internally by <a class="el" href="classServer.html#a53">Server::MeshSendCommon</a>. You should very rarely need to use it.
2132 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>.
2134 <div class="fragment"><pre>00850 {
2135 00851 <span class="keywordflow">if</span> (u)
2137 00853 <span class="keywordflow">return</span> CommonOnThisServer(u,(<span class="keywordtype">char</span>*)servername.c_str());
2139 00855 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;
2144 <a name="a52" doxytag="Server::MeshSendAll"></a><p>
2145 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2148 <table cellpadding="0" cellspacing="0" border="0">
2150 <td class="md" nowrap valign="top"> void Server::MeshSendAll </td>
2151 <td class="md" valign="top">( </td>
2152 <td class="md" nowrap valign="top">std::string </td>
2153 <td class="mdname1" valign="top" nowrap> <em>text</em> </td>
2154 <td class="md" valign="top"> ) </td>
2155 <td class="md" nowrap><code> [virtual]</code></td>
2162 <table cellspacing=5 cellpadding=0 border=0>
2170 Sends a line of text to all connected servers.
2172 If a server is not directly reachable, the core deals with routing the message, and will also deal with failures transparently.
2174 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>.
2176 <div class="fragment"><pre>00815 {
2177 00816 NetSendToAll((<span class="keywordtype">char</span>*)text.c_str());
2182 <a name="a54" doxytag="Server::MeshSendAllAlive"></a><p>
2183 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2186 <table cellpadding="0" cellspacing="0" border="0">
2188 <td class="md" nowrap valign="top"> void Server::MeshSendAllAlive </td>
2189 <td class="md" valign="top">( </td>
2190 <td class="md" nowrap valign="top">std::string </td>
2191 <td class="mdname1" valign="top" nowrap> <em>text</em> </td>
2192 <td class="md" valign="top"> ) </td>
2193 <td class="md" nowrap><code> [virtual]</code></td>
2200 <table cellspacing=5 cellpadding=0 border=0>
2208 This function is equivalent to Server::MeshSendToAll except it will only route to servers which are directly routable.
2212 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>.
2214 <div class="fragment"><pre>00826 {
2215 00827 NetSendToAllAlive((<span class="keywordtype">char</span>*)text.c_str());
2220 <a name="a56" doxytag="Server::MeshSendAllExcept"></a><p>
2221 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2224 <table cellpadding="0" cellspacing="0" border="0">
2226 <td class="md" nowrap valign="top"> void Server::MeshSendAllExcept </td>
2227 <td class="md" valign="top">( </td>
2228 <td class="md" nowrap valign="top">std::string </td>
2229 <td class="mdname" nowrap> <em>target</em>, </td>
2234 <td class="md" nowrap>std::string </td>
2235 <td class="mdname" nowrap> <em>text</em></td>
2239 <td class="md">) </td>
2240 <td class="md" colspan="2"><code> [virtual]</code></td>
2247 <table cellspacing=5 cellpadding=0 border=0>
2255 This function sends to all servers EXCEPT the one you specify.
2257 You should usually use this function to send messages, specifying the SENDER of your message as 'target'. This will prevent message loops.
2259 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>.
2261 <div class="fragment"><pre>00836 {
2262 00837 NetSendToAllExcept(target.c_str(),(<span class="keywordtype">char</span>*)text.c_str());
2267 <a name="a53" doxytag="Server::MeshSendCommon"></a><p>
2268 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2271 <table cellpadding="0" cellspacing="0" border="0">
2273 <td class="md" nowrap valign="top"> void Server::MeshSendCommon </td>
2274 <td class="md" valign="top">( </td>
2275 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2276 <td class="mdname" nowrap> <em>user</em>, </td>
2281 <td class="md" nowrap>std::string </td>
2282 <td class="mdname" nowrap> <em>text</em></td>
2286 <td class="md">) </td>
2287 <td class="md" colspan="2"><code> [virtual]</code></td>
2294 <table cellspacing=5 cellpadding=0 border=0>
2302 This method sends a line of text to all servers who have users which share common channels with the user you provide.
2304 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!)
2306 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>.
2308 <div class="fragment"><pre>00820 {
2309 00821 <span class="keywordflow">if</span> (user)
2310 00822 NetSendToCommon(user,(<span class="keywordtype">char</span>*)text.c_str());
2315 <a name="a55" doxytag="Server::MeshSendUnicast"></a><p>
2316 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2319 <table cellpadding="0" cellspacing="0" border="0">
2321 <td class="md" nowrap valign="top"> void Server::MeshSendUnicast </td>
2322 <td class="md" valign="top">( </td>
2323 <td class="md" nowrap valign="top">std::string </td>
2324 <td class="mdname" nowrap> <em>destination</em>, </td>
2329 <td class="md" nowrap>std::string </td>
2330 <td class="mdname" nowrap> <em>text</em></td>
2334 <td class="md">) </td>
2335 <td class="md" colspan="2"><code> [virtual]</code></td>
2342 <table cellspacing=5 cellpadding=0 border=0>
2350 This function sends a line of text directly to a server.
2352 If the server is not directly routable at this time, the server attempts to route text through the mesh.
2354 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>.
2356 <div class="fragment"><pre>00831 {
2357 00832 NetSendToOne((<span class="keywordtype">char</span>*)destination.c_str(),(<span class="keywordtype">char</span>*)text.c_str());
2362 <a name="a29" doxytag="Server::PartUserFromChannel"></a><p>
2363 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2366 <table cellpadding="0" cellspacing="0" border="0">
2368 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::PartUserFromChannel </td>
2369 <td class="md" valign="top">( </td>
2370 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2371 <td class="mdname" nowrap> <em>user</em>, </td>
2376 <td class="md" nowrap>std::string </td>
2377 <td class="mdname" nowrap> <em>cname</em>, </td>
2382 <td class="md" nowrap>std::string </td>
2383 <td class="mdname" nowrap> <em>reason</em></td>
2387 <td class="md">) </td>
2388 <td class="md" colspan="2"><code> [virtual]</code></td>
2395 <table cellspacing=5 cellpadding=0 border=0>
2403 Forces a user to part a channel.
2405 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.
2407 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>.
2409 <div class="fragment"><pre>00463 {
2410 00464 <span class="keywordflow">return</span> del_channel(user,cname.c_str(),reason.c_str(),<span class="keyword">false</span>);
2415 <a name="a39" doxytag="Server::PseudoToUser"></a><p>
2416 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2419 <table cellpadding="0" cellspacing="0" border="0">
2421 <td class="md" nowrap valign="top"> bool Server::PseudoToUser </td>
2422 <td class="md" valign="top">( </td>
2423 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2424 <td class="mdname" nowrap> <em>alive</em>, </td>
2429 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2430 <td class="mdname" nowrap> <em>zombie</em>, </td>
2435 <td class="md" nowrap>std::string </td>
2436 <td class="mdname" nowrap> <em>message</em></td>
2440 <td class="md">) </td>
2441 <td class="md" colspan="2"><code> [virtual]</code></td>
2448 <table cellspacing=5 cellpadding=0 border=0>
2456 This user takes one user, and switches their file descriptor with another user, so that one user "becomes" the other.
2458 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.
2460 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>.
2462 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>.
2464 <div class="fragment"><pre>00701 {
2465 00702 zombie-><a class="code" href="classconnection.html#o0">fd</a> = alive-><a class="code" href="classconnection.html#o0">fd</a>;
2466 00703 alive-><a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="modules_8h.html#a26">FD_MAGIC_NUMBER</a>;
2467 00704 alive-><a class="code" href="classuserrec.html#a10">ClearBuffer</a>();
2468 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>);
2469 00706 kill_link(alive,message.c_str());
2470 00707 <a class="code" href="modules_8cpp.html#a38">fd_ref_table</a>[zombie-><a class="code" href="classconnection.html#o0">fd</a>] = zombie;
2471 00708 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i != MAXCHANS; i++)
2473 00710 <span class="keywordflow">if</span> (zombie->chans[i].channel != NULL)
2475 00712 <span class="keywordflow">if</span> (zombie->chans[i].channel->name)
2477 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>;
2478 00715 WriteFrom(zombie->fd,zombie,<span class="stringliteral">"JOIN %s"</span>,Ptr-><a class="code" href="classchanrec.html#o0">name</a>);
2479 00716 <span class="keywordflow">if</span> (Ptr-><a class="code" href="classchanrec.html#o5">topicset</a>)
2481 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>);
2482 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>);
2484 00721 userlist(zombie,Ptr);
2485 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>);
2495 <a name="a31" doxytag="Server::QuitUser"></a><p>
2496 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2499 <table cellpadding="0" cellspacing="0" border="0">
2501 <td class="md" nowrap valign="top"> void Server::QuitUser </td>
2502 <td class="md" valign="top">( </td>
2503 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2504 <td class="mdname" nowrap> <em>user</em>, </td>
2509 <td class="md" nowrap>std::string </td>
2510 <td class="mdname" nowrap> <em>reason</em></td>
2514 <td class="md">) </td>
2515 <td class="md" colspan="2"><code> [virtual]</code></td>
2522 <table cellspacing=5 cellpadding=0 border=0>
2530 Forces a user to quit with the specified reason.
2532 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>
2534 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.
2536 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>.
2538 <div class="fragment"><pre>00485 {
2539 00486 kill_link(user,reason.c_str());
2544 <a name="a4" doxytag="Server::Send"></a><p>
2545 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2548 <table cellpadding="0" cellspacing="0" border="0">
2550 <td class="md" nowrap valign="top"> void Server::Send </td>
2551 <td class="md" valign="top">( </td>
2552 <td class="md" nowrap valign="top">int </td>
2553 <td class="mdname" nowrap> <em>Socket</em>, </td>
2558 <td class="md" nowrap>std::string </td>
2559 <td class="mdname" nowrap> <em>s</em></td>
2563 <td class="md">) </td>
2564 <td class="md" colspan="2"><code> [virtual]</code></td>
2571 <table cellspacing=5 cellpadding=0 border=0>
2579 Sends a line of text down a TCP/IP socket.
2581 This method writes a line of text to an established socket, cutting it to 510 characters plus a carriage return and linefeed if required.
2583 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>.
2585 <div class="fragment"><pre>00515 {
2586 00516 Write(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
2591 <a name="a9" doxytag="Server::SendChannel"></a><p>
2592 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2595 <table cellpadding="0" cellspacing="0" border="0">
2597 <td class="md" nowrap valign="top"> void Server::SendChannel </td>
2598 <td class="md" valign="top">( </td>
2599 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2600 <td class="mdname" nowrap> <em>User</em>, </td>
2605 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
2606 <td class="mdname" nowrap> <em>Channel</em>, </td>
2611 <td class="md" nowrap>std::string </td>
2612 <td class="mdname" nowrap> <em>s</em>, </td>
2617 <td class="md" nowrap>bool </td>
2618 <td class="mdname" nowrap> <em>IncludeSender</em></td>
2622 <td class="md">) </td>
2623 <td class="md" colspan="2"><code> [virtual]</code></td>
2630 <table cellspacing=5 cellpadding=0 border=0>
2638 Sends text from a user to a channel (mulicast).
2640 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).
2642 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>.
2644 <div class="fragment"><pre>00549 {
2645 00550 <span class="keywordflow">if</span> (IncludeSender)
2647 00552 WriteChannel(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
2649 00554 <span class="keywordflow">else</span>
2651 00556 ChanExceptSender(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
2657 <a name="a6" doxytag="Server::SendChannelServerNotice"></a><p>
2658 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2661 <table cellpadding="0" cellspacing="0" border="0">
2663 <td class="md" nowrap valign="top"> void Server::SendChannelServerNotice </td>
2664 <td class="md" valign="top">( </td>
2665 <td class="md" nowrap valign="top">std::string </td>
2666 <td class="mdname" nowrap> <em>ServName</em>, </td>
2671 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
2672 <td class="mdname" nowrap> <em>Channel</em>, </td>
2677 <td class="md" nowrap>std::string </td>
2678 <td class="mdname" nowrap> <em>text</em></td>
2682 <td class="md">) </td>
2683 <td class="md" colspan="2"><code> [virtual]</code></td>
2690 <table cellspacing=5 cellpadding=0 border=0>
2698 Writes text to a channel, but from a server, including all.
2700 This can be used to send server notices to a group of users.
2702 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>.
2704 <div class="fragment"><pre>00544 {
2705 00545 WriteChannelWithServ((<span class="keywordtype">char</span>*)ServName.c_str(), Channel, <span class="stringliteral">"%s"</span>, text.c_str());
2710 <a name="a11" doxytag="Server::SendCommon"></a><p>
2711 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2714 <table cellpadding="0" cellspacing="0" border="0">
2716 <td class="md" nowrap valign="top"> void Server::SendCommon </td>
2717 <td class="md" valign="top">( </td>
2718 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2719 <td class="mdname" nowrap> <em>User</em>, </td>
2724 <td class="md" nowrap>std::string </td>
2725 <td class="mdname" nowrap> <em>text</em>, </td>
2730 <td class="md" nowrap>bool </td>
2731 <td class="mdname" nowrap> <em>IncludeSender</em></td>
2735 <td class="md">) </td>
2736 <td class="md" colspan="2"><code> [virtual]</code></td>
2743 <table cellspacing=5 cellpadding=0 border=0>
2751 Sends text from a user to one or more channels (mulicast).
2753 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.
2755 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>.
2757 <div class="fragment"><pre>00566 {
2758 00567 <span class="keywordflow">if</span> (IncludeSender)
2760 00569 WriteCommon(User,<span class="stringliteral">"%s"</span>,text.c_str());
2762 00571 <span class="keywordflow">else</span>
2764 00573 WriteCommonExcept(User,<span class="stringliteral">"%s"</span>,text.c_str());
2770 <a name="a7" doxytag="Server::SendFrom"></a><p>
2771 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2774 <table cellpadding="0" cellspacing="0" border="0">
2776 <td class="md" nowrap valign="top"> void Server::SendFrom </td>
2777 <td class="md" valign="top">( </td>
2778 <td class="md" nowrap valign="top">int </td>
2779 <td class="mdname" nowrap> <em>Socket</em>, </td>
2784 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2785 <td class="mdname" nowrap> <em>User</em>, </td>
2790 <td class="md" nowrap>std::string </td>
2791 <td class="mdname" nowrap> <em>s</em></td>
2795 <td class="md">) </td>
2796 <td class="md" colspan="2"><code> [virtual]</code></td>
2803 <table cellspacing=5 cellpadding=0 border=0>
2811 Sends text from a user to a socket.
2813 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)
2815 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>.
2817 <div class="fragment"><pre>00525 {
2818 00526 WriteFrom(Socket,User,<span class="stringliteral">"%s"</span>,s.c_str());
2823 <a name="a26" doxytag="Server::SendMode"></a><p>
2824 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2827 <table cellpadding="0" cellspacing="0" border="0">
2829 <td class="md" nowrap valign="top"> void Server::SendMode </td>
2830 <td class="md" valign="top">( </td>
2831 <td class="md" nowrap valign="top">char ** </td>
2832 <td class="mdname" nowrap> <em>parameters</em>, </td>
2837 <td class="md" nowrap>int </td>
2838 <td class="mdname" nowrap> <em>pcnt</em>, </td>
2843 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2844 <td class="mdname" nowrap> <em>user</em></td>
2848 <td class="md">) </td>
2849 <td class="md" colspan="2"><code> [virtual]</code></td>
2856 <table cellspacing=5 cellpadding=0 border=0>
2866 you must format the parameters array with the target, modes and parameters for those modes.<p>
2869 modes[0] = ChannelName;<p>
2871 modes[2] = user->nick;<p>
2872 Srv->SendMode(modes,3,user);<p>
2873 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!
2875 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>.
2877 References <a class="el" href="modules_8h.html#a36">server_mode()</a>.
2879 <div class="fragment"><pre>00510 {
2880 00511 <a class="code" href="modules_8h.html#a36">server_mode</a>(parameters,pcnt,user);
2885 <a name="a2" doxytag="Server::SendOpers"></a><p>
2886 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2889 <table cellpadding="0" cellspacing="0" border="0">
2891 <td class="md" nowrap valign="top"> void Server::SendOpers </td>
2892 <td class="md" valign="top">( </td>
2893 <td class="md" nowrap valign="top">std::string </td>
2894 <td class="mdname1" valign="top" nowrap> <em>s</em> </td>
2895 <td class="md" valign="top"> ) </td>
2896 <td class="md" nowrap><code> [virtual]</code></td>
2903 <table cellspacing=5 cellpadding=0 border=0>
2911 Sends text to all opers.
2913 This method sends a server notice to all opers with the usermode +s.
2915 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>.
2917 <div class="fragment"><pre>00440 {
2918 00441 WriteOpers(<span class="stringliteral">"%s"</span>,s.c_str());
2923 <a name="a5" doxytag="Server::SendServ"></a><p>
2924 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2927 <table cellpadding="0" cellspacing="0" border="0">
2929 <td class="md" nowrap valign="top"> void Server::SendServ </td>
2930 <td class="md" valign="top">( </td>
2931 <td class="md" nowrap valign="top">int </td>
2932 <td class="mdname" nowrap> <em>Socket</em>, </td>
2937 <td class="md" nowrap>std::string </td>
2938 <td class="mdname" nowrap> <em>s</em></td>
2942 <td class="md">) </td>
2943 <td class="md" colspan="2"><code> [virtual]</code></td>
2950 <table cellspacing=5 cellpadding=0 border=0>
2958 Sends text from the server to a socket.
2960 This method writes a line of text to an established socket, with the servername prepended as used by numerics (see RFC 1459)
2962 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>.
2964 <div class="fragment"><pre>00520 {
2965 00521 WriteServ(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
2970 <a name="a8" doxytag="Server::SendTo"></a><p>
2971 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2974 <table cellpadding="0" cellspacing="0" border="0">
2976 <td class="md" nowrap valign="top"> void Server::SendTo </td>
2977 <td class="md" valign="top">( </td>
2978 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2979 <td class="mdname" nowrap> <em>Source</em>, </td>
2984 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2985 <td class="mdname" nowrap> <em>Dest</em>, </td>
2990 <td class="md" nowrap>std::string </td>
2991 <td class="mdname" nowrap> <em>s</em></td>
2995 <td class="md">) </td>
2996 <td class="md" colspan="2"><code> [virtual]</code></td>
3003 <table cellspacing=5 cellpadding=0 border=0>
3011 Sends text from a user to another user.
3013 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>
3015 The format will become:<p>
3016 :localserver TEXT<p>
3017 Which is useful for numerics and server notices to single users, etc.
3019 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>.
3021 References <a class="el" href="connection_8h-source.html#l00215">connection::fd</a>.
3023 <div class="fragment"><pre>00530 {
3024 00531 <span class="keywordflow">if</span> (!Source)
3026 00533 <span class="comment">// if source is NULL, then the message originates from the local server</span>
3027 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());
3029 00536 <span class="keywordflow">else</span>
3031 00538 <span class="comment">// otherwise it comes from the user specified</span>
3032 00539 WriteTo(Source,Dest,<span class="stringliteral">"%s"</span>,s.c_str());
3038 <a name="a27" doxytag="Server::SendToModeMask"></a><p>
3039 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3042 <table cellpadding="0" cellspacing="0" border="0">
3044 <td class="md" nowrap valign="top"> void Server::SendToModeMask </td>
3045 <td class="md" valign="top">( </td>
3046 <td class="md" nowrap valign="top">std::string </td>
3047 <td class="mdname" nowrap> <em>modes</em>, </td>
3052 <td class="md" nowrap>int </td>
3053 <td class="mdname" nowrap> <em>flags</em>, </td>
3058 <td class="md" nowrap>std::string </td>
3059 <td class="mdname" nowrap> <em>text</em></td>
3063 <td class="md">) </td>
3064 <td class="md" colspan="2"><code> [virtual]</code></td>
3071 <table cellspacing=5 cellpadding=0 border=0>
3079 Sends to all users matching a mode mask You must specify one or more usermodes as the first parameter.
3081 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>
3082 Serv->SendToModeMask("xi", WM_OR, "m00");<p>
3083 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.
3085 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>.
3087 <div class="fragment"><pre>00453 {
3088 00454 WriteMode(modes.c_str(),flags,<span class="stringliteral">"%s"</span>,text.c_str());
3093 <a name="a12" doxytag="Server::SendWallops"></a><p>
3094 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3097 <table cellpadding="0" cellspacing="0" border="0">
3099 <td class="md" nowrap valign="top"> void Server::SendWallops </td>
3100 <td class="md" valign="top">( </td>
3101 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
3102 <td class="mdname" nowrap> <em>User</em>, </td>
3107 <td class="md" nowrap>std::string </td>
3108 <td class="mdname" nowrap> <em>text</em></td>
3112 <td class="md">) </td>
3113 <td class="md" colspan="2"><code> [virtual]</code></td>
3120 <table cellspacing=5 cellpadding=0 border=0>
3128 Sends a WALLOPS message.
3130 This method writes a WALLOPS message to all users with the +w flag, originating from the specified user.
3132 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>.
3134 <div class="fragment"><pre>00578 {
3135 00579 WriteWallOps(User,<span class="keyword">false</span>,<span class="stringliteral">"%s"</span>,text.c_str());
3140 <a name="a38" doxytag="Server::UserToPseudo"></a><p>
3141 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3144 <table cellpadding="0" cellspacing="0" border="0">
3146 <td class="md" nowrap valign="top"> bool Server::UserToPseudo </td>
3147 <td class="md" valign="top">( </td>
3148 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
3149 <td class="mdname" nowrap> <em>user</em>, </td>
3154 <td class="md" nowrap>std::string </td>
3155 <td class="mdname" nowrap> <em>message</em></td>
3159 <td class="md">) </td>
3160 <td class="md" colspan="2"><code> [virtual]</code></td>
3167 <table cellspacing=5 cellpadding=0 border=0>
3175 Remove a user's connection to the irc server, but leave their client in existence in the user hash.
3177 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.
3179 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>.
3181 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>.
3183 <div class="fragment"><pre>00682 {
3184 00683 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> old_fd = user-><a class="code" href="classconnection.html#o0">fd</a>;
3185 00684 user-><a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="modules_8h.html#a26">FD_MAGIC_NUMBER</a>;
3186 00685 user-><a class="code" href="classuserrec.html#a10">ClearBuffer</a>();
3187 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());
3188 00687 <span class="preprocessor">#ifdef USE_KQUEUE</span>
3189 00688 <span class="preprocessor"></span> <span class="keyword">struct </span>kevent ke;
3190 00689 EV_SET(&ke, old_fd, EVFILT_READ, EV_DELETE, 0, 0, NULL);
3191 00690 <span class="keywordtype">int</span> i = kevent(kq, &ke, 1, 0, 0, NULL);
3192 00691 <span class="keywordflow">if</span> (i == -1)
3194 00693 log(DEBUG,<span class="stringliteral">"kqueue: Failed to remove user from queue!"</span>);
3196 00695 <span class="preprocessor">#endif</span>
3197 00696 <span class="preprocessor"></span> shutdown(old_fd,2);
3198 00697 close(old_fd);
3203 <hr>The documentation for this class was generated from the following files:<ul>
3204 <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>
3205 <hr size="1"><address style="align: right;"><small>Generated on Fri May 13 15:49:55 2005 for InspIRCd by
3206 <a href="http://www.doxygen.org/index.html">
3207 <img src="doxygen.png" alt="doxygen" align="middle" border=0 >
3208 </a>1.3.3 </small></address>