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="namespacemembers.html">Namespace Members</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 std::string </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a22">GetServerDescription</a> ()</td></tr>
92 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the server description string of the local server. </em> <a href="#a22"></a><em><br><br></td></tr>
93 <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#a23">GetAdmin</a> ()</td></tr>
95 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the information of the server as returned by the /ADMIN command. </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">AddExtendedMode</a> (char modechar, int type, bool requires_oper, int params_when_on, int params_when_off)</td></tr>
98 <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds an extended mode letter which is parsed by a module. </em> <a href="#a24"></a><em><br><br></td></tr>
99 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a25">AddExtendedListMode</a> (char modechar)</td></tr>
101 <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="#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">AddCommand</a> (char *cmd, handlerfunc f, char flags, int minparams, char *source)</td></tr>
104 <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a command to the command table. </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">SendMode</a> (char **parameters, int pcnt, <a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
107 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends a servermode. </em> <a href="#a27"></a><em><br><br></td></tr>
108 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a28">SendToModeMask</a> (std::string modes, int flags, std::string text)</td></tr>
110 <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="#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">JoinUserToChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string cname, std::string key)</td></tr>
113 <tr><td class="mdescLeft"> </td><td class="mdescRight">Forces a user to join a channel. </em> <a href="#a29"></a><em><br><br></td></tr>
114 <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#a30">PartUserFromChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string cname, std::string reason)</td></tr>
116 <tr><td class="mdescLeft"> </td><td class="mdescRight">Forces a user to part a channel. </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">ChangeUserNick</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string nickname)</td></tr>
119 <tr><td class="mdescLeft"> </td><td class="mdescRight">Forces a user nickchange. </em> <a href="#a31"></a><em><br><br></td></tr>
120 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a32">QuitUser</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string reason)</td></tr>
122 <tr><td class="mdescLeft"> </td><td class="mdescRight">Forces a user to quit with the specified reason. </em> <a href="#a32"></a><em><br><br></td></tr>
123 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a33">MatchText</a> (std::string sliteral, std::string spattern)</td></tr>
125 <tr><td class="mdescLeft"> </td><td class="mdescRight">Matches text against a glob pattern. </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">CallCommandHandler</a> (std::string commandname, char **parameters, int pcnt, <a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
128 <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="#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">ChangeHost</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string host)</td></tr>
131 <tr><td class="mdescLeft"> </td><td class="mdescRight">Change displayed hostname of a user. </em> <a href="#a35"></a><em><br><br></td></tr>
132 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a36">ChangeGECOS</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string gecos)</td></tr>
134 <tr><td class="mdescLeft"> </td><td class="mdescRight">Change GECOS (fullname) of a user. </em> <a href="#a36"></a><em><br><br></td></tr>
135 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a37">IsUlined</a> (std::string server)</td></tr>
137 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the servername you give is ulined. </em> <a href="#a37"></a><em><br><br></td></tr>
138 <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#a38">GetUsers</a> (<a class="el" href="classchanrec.html">chanrec</a> *chan)</td></tr>
140 <tr><td class="mdescLeft"> </td><td class="mdescRight">Fetches the userlist of a channel. </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">UserToPseudo</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string message)</td></tr>
143 <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="#a39"></a><em><br><br></td></tr>
144 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a40">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>
146 <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="#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">AddGLine</a> (long duration, std::string source, std::string reason, std::string hostmask)</td></tr>
149 <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a 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="#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">AddQLine</a> (long duration, std::string source, std::string reason, std::string nickname)</td></tr>
152 <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="#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">AddZLine</a> (long duration, std::string source, std::string reason, std::string ipaddr)</td></tr>
155 <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="#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">AddKLine</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 K-line The K-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 void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a45">AddELine</a> (long duration, std::string source, std::string reason, std::string hostmask)</td></tr>
161 <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="#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">DelGLine</a> (std::string hostmask)</td></tr>
164 <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a G-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">DelQLine</a> (std::string nickname)</td></tr>
167 <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a Q-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">DelZLine</a> (std::string ipaddr)</td></tr>
170 <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a Z-Line from all servers on the mesh. </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">DelKLine</a> (std::string hostmask)</td></tr>
173 <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a local K-Line. </em> <a href="#a49"></a><em><br><br></td></tr>
174 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a50">DelELine</a> (std::string hostmask)</td></tr>
176 <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a local E-Line. </em> <a href="#a50"></a><em><br><br></td></tr>
177 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual long </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a51">CalcDuration</a> (std::string duration)</td></tr>
179 <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="#a51"></a><em><br><br></td></tr>
180 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a52">IsValidMask</a> (std::string mask)</td></tr>
182 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns true if a nick!ident string is correctly formatted, false if otherwise. </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">MeshSendAll</a> (std::string text)</td></tr>
185 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends a line of text to all connected servers. </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">MeshSendCommon</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string text)</td></tr>
188 <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="#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">MeshSendAllAlive</a> (std::string text)</td></tr>
191 <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="#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">MeshSendUnicast</a> (std::string destination, std::string text)</td></tr>
194 <tr><td class="mdescLeft"> </td><td class="mdescRight">This function sends a line of text directly to a server. </em> <a href="#a56"></a><em><br><br></td></tr>
195 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a57">MeshSendAllExcept</a> (std::string target, std::string text)</td></tr>
197 <tr><td class="mdescLeft"> </td><td class="mdescRight">This function sends to all servers EXCEPT the one you specify. </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">MeshCheckChan</a> (<a class="el" href="classchanrec.html">chanrec</a> *c, std::string servername)</td></tr>
200 <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="#a58"></a><em><br><br></td></tr>
201 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a59">MeshCheckCommon</a> (<a class="el" href="classuserrec.html">userrec</a> *u, std::string servername)</td></tr>
203 <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="#a59"></a><em><br><br></td></tr>
204 <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#a60">FindModule</a> (std::string name)</td></tr>
206 <tr><td class="mdescLeft"> </td><td class="mdescRight">This function finds a module by name. </em> <a href="#a60"></a><em><br><br></td></tr>
208 <hr><a name="_details"></a><h2>Detailed Description</h2>
209 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.
211 All modules should instantiate at least one copy of this class, and use its member functions to perform their tasks.
215 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>
216 <a name="a0" doxytag="Server::Server"></a><p>
217 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
220 <table cellpadding="0" cellspacing="0" border="0">
222 <td class="md" nowrap valign="top"> Server::Server </td>
223 <td class="md" valign="top">( </td>
224 <td class="mdname1" valign="top" nowrap> </td>
225 <td class="md" valign="top"> ) </td>
226 <td class="md" nowrap></td>
233 <table cellspacing=5 cellpadding=0 border=0>
243 Creates a Server object.
245 Definition at line <a class="el" href="modules_8cpp-source.html#l00364">364</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
247 <div class="fragment"><pre>00365 {
252 <a name="a1" doxytag="Server::~Server"></a><p>
253 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
256 <table cellpadding="0" cellspacing="0" border="0">
258 <td class="md" nowrap valign="top"> Server::~<a class="el" href="classServer.html">Server</a> </td>
259 <td class="md" valign="top">( </td>
260 <td class="mdname1" valign="top" nowrap> </td>
261 <td class="md" valign="top"> ) </td>
262 <td class="md" nowrap><code> [virtual]</code></td>
269 <table cellspacing=5 cellpadding=0 border=0>
279 Destroys a Server object.
281 Definition at line <a class="el" href="modules_8cpp-source.html#l00368">368</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
283 <div class="fragment"><pre>00369 {
288 <hr><h2>Member Function Documentation</h2>
289 <a name="a26" doxytag="Server::AddCommand"></a><p>
290 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
293 <table cellpadding="0" cellspacing="0" border="0">
295 <td class="md" nowrap valign="top"> void Server::AddCommand </td>
296 <td class="md" valign="top">( </td>
297 <td class="md" nowrap valign="top">char * </td>
298 <td class="mdname" nowrap> <em>cmd</em>, </td>
303 <td class="md" nowrap>handlerfunc </td>
304 <td class="mdname" nowrap> <em>f</em>, </td>
309 <td class="md" nowrap>char </td>
310 <td class="mdname" nowrap> <em>flags</em>, </td>
315 <td class="md" nowrap>int </td>
316 <td class="mdname" nowrap> <em>minparams</em>, </td>
321 <td class="md" nowrap>char * </td>
322 <td class="mdname" nowrap> <em>source</em></td>
326 <td class="md">) </td>
327 <td class="md" colspan="2"><code> [virtual]</code></td>
334 <table cellspacing=5 cellpadding=0 border=0>
342 Adds a command to the command table.
344 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>
345 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>
346 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.
348 Definition at line <a class="el" href="modules_8cpp-source.html#l00437">437</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
350 References <a class="el" href="modules_8h.html#a35">createcommand()</a>.
352 <div class="fragment"><pre>00438 {
353 00439 <a class="code" href="modules_8h.html#a35">createcommand</a>(cmd,f,flags,minparams,source);
358 <a name="a45" doxytag="Server::AddELine"></a><p>
359 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
362 <table cellpadding="0" cellspacing="0" border="0">
364 <td class="md" nowrap valign="top"> void Server::AddELine </td>
365 <td class="md" valign="top">( </td>
366 <td class="md" nowrap valign="top">long </td>
367 <td class="mdname" nowrap> <em>duration</em>, </td>
372 <td class="md" nowrap>std::string </td>
373 <td class="mdname" nowrap> <em>source</em>, </td>
378 <td class="md" nowrap>std::string </td>
379 <td class="mdname" nowrap> <em>reason</em>, </td>
384 <td class="md" nowrap>std::string </td>
385 <td class="mdname" nowrap> <em>hostmask</em></td>
389 <td class="md">) </td>
390 <td class="md" colspan="2"><code> [virtual]</code></td>
397 <table cellspacing=5 cellpadding=0 border=0>
405 Adds a E-line The E-line is enforced as soon as it is added.
407 The duration must be in seconds, however you can use the <a class="el" href="classServer.html#a51">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.
409 Definition at line <a class="el" href="modules_8cpp-source.html#l00699">699</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
411 References <a class="el" href="xline_8h.html#a5">add_eline()</a>, and <a class="el" href="commands_8h.html#a76">duration()</a>.
413 <div class="fragment"><pre>00700 {
414 00701 <a class="code" href="xline_8h.html#a5">add_eline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
419 <a name="a25" doxytag="Server::AddExtendedListMode"></a><p>
420 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
423 <table cellpadding="0" cellspacing="0" border="0">
425 <td class="md" nowrap valign="top"> bool Server::AddExtendedListMode </td>
426 <td class="md" valign="top">( </td>
427 <td class="md" nowrap valign="top">char </td>
428 <td class="mdname1" valign="top" nowrap> <em>modechar</em> </td>
429 <td class="md" valign="top"> ) </td>
430 <td class="md" nowrap><code> [virtual]</code></td>
437 <table cellspacing=5 cellpadding=0 border=0>
445 Adds an extended mode letter which is parsed by a module and handled in a list fashion.
447 This call is used to implement modes like +q and +a. The characteristics of these modes are as follows:<p>
448 (1) They are ALWAYS on channels, not on users, therefore their type is MT_CHANNEL<p>
449 (2) They always take exactly one parameter when being added or removed<p>
450 (3) They can be set multiple times, usually on users in channels<p>
451 (4) The mode and its parameter are NOT stored in the channels modes structure<p>
452 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.
454 Definition at line <a class="el" href="modules_8cpp-source.html#l00605">605</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
456 References <a class="el" href="modules_8cpp-source.html#l00218">DoAddExtendedMode()</a>, <a class="el" href="modules_8cpp-source.html#l00228">ModeMakeList()</a>, and <a class="el" href="modules_8h-source.html#l00031">MT_CHANNEL</a>.
458 <div class="fragment"><pre>00606 {
459 00607 <span class="keywordtype">bool</span> res = <a class="code" href="modules_8cpp.html#a57">DoAddExtendedMode</a>(modechar,MT_CHANNEL,<span class="keyword">false</span>,1,1);
460 00608 <span class="keywordflow">if</span> (res)
461 00609 <a class="code" href="modules_8cpp.html#a58">ModeMakeList</a>(modechar);
462 00610 <span class="keywordflow">return</span> res;
467 <a name="a24" doxytag="Server::AddExtendedMode"></a><p>
468 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
471 <table cellpadding="0" cellspacing="0" border="0">
473 <td class="md" nowrap valign="top"> bool Server::AddExtendedMode </td>
474 <td class="md" valign="top">( </td>
475 <td class="md" nowrap valign="top">char </td>
476 <td class="mdname" nowrap> <em>modechar</em>, </td>
481 <td class="md" nowrap>int </td>
482 <td class="mdname" nowrap> <em>type</em>, </td>
487 <td class="md" nowrap>bool </td>
488 <td class="mdname" nowrap> <em>requires_oper</em>, </td>
493 <td class="md" nowrap>int </td>
494 <td class="mdname" nowrap> <em>params_when_on</em>, </td>
499 <td class="md" nowrap>int </td>
500 <td class="mdname" nowrap> <em>params_when_off</em></td>
504 <td class="md">) </td>
505 <td class="md" colspan="2"><code> [virtual]</code></td>
512 <table cellspacing=5 cellpadding=0 border=0>
520 Adds an extended mode letter which is parsed by a module.
522 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.
524 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>.
526 References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, <a class="el" href="modules_8cpp-source.html#l00218">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>.
528 <div class="fragment"><pre>00578 {
529 00579 <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>)))
531 00581 <span class="keywordflow">if</span> (type == <a class="code" href="modules_8h.html#a7">MT_SERVER</a>)
533 00583 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion"</span>);
534 00584 <span class="keywordflow">return</span> <span class="keyword">false</span>;
536 00586 <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>))
538 00588 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Parameters on MT_CLIENT modes are not supported"</span>);
539 00589 <span class="keywordflow">return</span> <span class="keyword">false</span>;
541 00591 <span class="keywordflow">if</span> ((params_when_on>1) || (params_when_off>1))
543 00593 log(DEBUG,<span class="stringliteral">"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported"</span>);
544 00594 <span class="keywordflow">return</span> <span class="keyword">false</span>;
546 00596 <span class="keywordflow">return</span> <a class="code" href="modules_8cpp.html#a57">DoAddExtendedMode</a>(modechar,type,requires_oper,params_when_on,params_when_off);
548 00598 <span class="keywordflow">else</span>
550 00600 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Muppet modechar detected."</span>);
552 00602 <span class="keywordflow">return</span> <span class="keyword">false</span>;
557 <a name="a41" doxytag="Server::AddGLine"></a><p>
558 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
561 <table cellpadding="0" cellspacing="0" border="0">
563 <td class="md" nowrap valign="top"> void Server::AddGLine </td>
564 <td class="md" valign="top">( </td>
565 <td class="md" nowrap valign="top">long </td>
566 <td class="mdname" nowrap> <em>duration</em>, </td>
571 <td class="md" nowrap>std::string </td>
572 <td class="mdname" nowrap> <em>source</em>, </td>
577 <td class="md" nowrap>std::string </td>
578 <td class="mdname" nowrap> <em>reason</em>, </td>
583 <td class="md" nowrap>std::string </td>
584 <td class="mdname" nowrap> <em>hostmask</em></td>
588 <td class="md">) </td>
589 <td class="md" colspan="2"><code> [virtual]</code></td>
596 <table cellspacing=5 cellpadding=0 border=0>
604 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.
606 The duration must be in seconds, however you can use the <a class="el" href="classServer.html#a51">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.
608 Definition at line <a class="el" href="modules_8cpp-source.html#l00679">679</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
610 References <a class="el" href="xline_8h.html#a1">add_gline()</a>, and <a class="el" href="commands_8h.html#a76">duration()</a>.
612 <div class="fragment"><pre>00680 {
613 00681 <a class="code" href="xline_8h.html#a1">add_gline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
618 <a name="a44" doxytag="Server::AddKLine"></a><p>
619 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
622 <table cellpadding="0" cellspacing="0" border="0">
624 <td class="md" nowrap valign="top"> void Server::AddKLine </td>
625 <td class="md" valign="top">( </td>
626 <td class="md" nowrap valign="top">long </td>
627 <td class="mdname" nowrap> <em>duration</em>, </td>
632 <td class="md" nowrap>std::string </td>
633 <td class="mdname" nowrap> <em>source</em>, </td>
638 <td class="md" nowrap>std::string </td>
639 <td class="mdname" nowrap> <em>reason</em>, </td>
644 <td class="md" nowrap>std::string </td>
645 <td class="mdname" nowrap> <em>hostmask</em></td>
649 <td class="md">) </td>
650 <td class="md" colspan="2"><code> [virtual]</code></td>
657 <table cellspacing=5 cellpadding=0 border=0>
665 Adds a K-line The K-line is enforced as soon as it is added.
667 The duration must be in seconds, however you can use the <a class="el" href="classServer.html#a51">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.
669 Definition at line <a class="el" href="modules_8cpp-source.html#l00694">694</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
671 References <a class="el" href="xline_8h.html#a4">add_kline()</a>, and <a class="el" href="commands_8h.html#a76">duration()</a>.
673 <div class="fragment"><pre>00695 {
674 00696 <a class="code" href="xline_8h.html#a4">add_kline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
679 <a name="a42" doxytag="Server::AddQLine"></a><p>
680 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
683 <table cellpadding="0" cellspacing="0" border="0">
685 <td class="md" nowrap valign="top"> void Server::AddQLine </td>
686 <td class="md" valign="top">( </td>
687 <td class="md" nowrap valign="top">long </td>
688 <td class="mdname" nowrap> <em>duration</em>, </td>
693 <td class="md" nowrap>std::string </td>
694 <td class="mdname" nowrap> <em>source</em>, </td>
699 <td class="md" nowrap>std::string </td>
700 <td class="mdname" nowrap> <em>reason</em>, </td>
705 <td class="md" nowrap>std::string </td>
706 <td class="mdname" nowrap> <em>nickname</em></td>
710 <td class="md">) </td>
711 <td class="md" colspan="2"><code> [virtual]</code></td>
718 <table cellspacing=5 cellpadding=0 border=0>
726 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.
728 The duration must be in seconds, however you can use the <a class="el" href="classServer.html#a51">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.
730 Definition at line <a class="el" href="modules_8cpp-source.html#l00684">684</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
732 References <a class="el" href="xline_8h.html#a2">add_qline()</a>, and <a class="el" href="commands_8h.html#a76">duration()</a>.
734 <div class="fragment"><pre>00685 {
735 00686 <a class="code" href="xline_8h.html#a2">add_qline</a>(duration, source.c_str(), reason.c_str(), nickname.c_str());
740 <a name="a43" doxytag="Server::AddZLine"></a><p>
741 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
744 <table cellpadding="0" cellspacing="0" border="0">
746 <td class="md" nowrap valign="top"> void Server::AddZLine </td>
747 <td class="md" valign="top">( </td>
748 <td class="md" nowrap valign="top">long </td>
749 <td class="mdname" nowrap> <em>duration</em>, </td>
754 <td class="md" nowrap>std::string </td>
755 <td class="mdname" nowrap> <em>source</em>, </td>
760 <td class="md" nowrap>std::string </td>
761 <td class="mdname" nowrap> <em>reason</em>, </td>
766 <td class="md" nowrap>std::string </td>
767 <td class="mdname" nowrap> <em>ipaddr</em></td>
771 <td class="md">) </td>
772 <td class="md" colspan="2"><code> [virtual]</code></td>
779 <table cellspacing=5 cellpadding=0 border=0>
787 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.
789 The duration must be in seconds, however you can use the <a class="el" href="classServer.html#a51">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.
791 Definition at line <a class="el" href="modules_8cpp-source.html#l00689">689</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
793 References <a class="el" href="xline_8h.html#a3">add_zline()</a>, and <a class="el" href="commands_8h.html#a76">duration()</a>.
795 <div class="fragment"><pre>00690 {
796 00691 <a class="code" href="xline_8h.html#a3">add_zline</a>(duration, source.c_str(), reason.c_str(), ipaddr.c_str());
801 <a name="a51" doxytag="Server::CalcDuration"></a><p>
802 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
805 <table cellpadding="0" cellspacing="0" border="0">
807 <td class="md" nowrap valign="top"> long Server::CalcDuration </td>
808 <td class="md" valign="top">( </td>
809 <td class="md" nowrap valign="top">std::string </td>
810 <td class="mdname1" valign="top" nowrap> <em>duration</em> </td>
811 <td class="md" valign="top"> ) </td>
812 <td class="md" nowrap><code> [virtual]</code></td>
819 <table cellspacing=5 cellpadding=0 border=0>
827 Calculates a duration This method will take a string containing a formatted duration (e.g.
829 "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.
831 Definition at line <a class="el" href="modules_8cpp-source.html#l00729">729</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
833 References <a class="el" href="commands_8h.html#a76">duration()</a>.
835 <div class="fragment"><pre>00730 {
836 00731 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a76">duration</a>(delta.c_str());
841 <a name="a34" doxytag="Server::CallCommandHandler"></a><p>
842 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
845 <table cellpadding="0" cellspacing="0" border="0">
847 <td class="md" nowrap valign="top"> void Server::CallCommandHandler </td>
848 <td class="md" valign="top">( </td>
849 <td class="md" nowrap valign="top">std::string </td>
850 <td class="mdname" nowrap> <em>commandname</em>, </td>
855 <td class="md" nowrap>char ** </td>
856 <td class="mdname" nowrap> <em>parameters</em>, </td>
861 <td class="md" nowrap>int </td>
862 <td class="mdname" nowrap> <em>pcnt</em>, </td>
867 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
868 <td class="mdname" nowrap> <em>user</em></td>
872 <td class="md">) </td>
873 <td class="md" colspan="2"><code> [virtual]</code></td>
880 <table cellspacing=5 cellpadding=0 border=0>
888 Calls the handler for a command, either implemented by the core or by another module.
890 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>
891 ) 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#a26">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.
893 Definition at line <a class="el" href="modules_8cpp-source.html#l00427">427</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
895 <div class="fragment"><pre>00428 {
896 00429 call_handler(commandname.c_str(),parameters,pcnt,user);
901 <a name="a36" doxytag="Server::ChangeGECOS"></a><p>
902 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
905 <table cellpadding="0" cellspacing="0" border="0">
907 <td class="md" nowrap valign="top"> void Server::ChangeGECOS </td>
908 <td class="md" valign="top">( </td>
909 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
910 <td class="mdname" nowrap> <em>user</em>, </td>
915 <td class="md" nowrap>std::string </td>
916 <td class="mdname" nowrap> <em>gecos</em></td>
920 <td class="md">) </td>
921 <td class="md" colspan="2"><code> [virtual]</code></td>
928 <table cellspacing=5 cellpadding=0 border=0>
936 Change GECOS (fullname) of a user.
938 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.
940 Definition at line <a class="el" href="modules_8cpp-source.html#l00520">520</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
942 References <a class="el" href="message_8h.html#a8">ChangeName()</a>.
944 <div class="fragment"><pre>00521 {
945 00522 <a class="code" href="message_8h.html#a8">ChangeName</a>(user,gecos.c_str());
950 <a name="a35" doxytag="Server::ChangeHost"></a><p>
951 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
954 <table cellpadding="0" cellspacing="0" border="0">
956 <td class="md" nowrap valign="top"> void Server::ChangeHost </td>
957 <td class="md" valign="top">( </td>
958 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
959 <td class="mdname" nowrap> <em>user</em>, </td>
964 <td class="md" nowrap>std::string </td>
965 <td class="mdname" nowrap> <em>host</em></td>
969 <td class="md">) </td>
970 <td class="md" colspan="2"><code> [virtual]</code></td>
977 <table cellspacing=5 cellpadding=0 border=0>
985 Change displayed hostname of a user.
987 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.
989 Definition at line <a class="el" href="modules_8cpp-source.html#l00515">515</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
991 References <a class="el" href="message_8h.html#a9">ChangeDisplayedHost()</a>.
993 <div class="fragment"><pre>00516 {
994 00517 <a class="code" href="message_8h.html#a9">ChangeDisplayedHost</a>(user,host.c_str());
999 <a name="a31" doxytag="Server::ChangeUserNick"></a><p>
1000 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1003 <table cellpadding="0" cellspacing="0" border="0">
1005 <td class="md" nowrap valign="top"> void Server::ChangeUserNick </td>
1006 <td class="md" valign="top">( </td>
1007 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1008 <td class="mdname" nowrap> <em>user</em>, </td>
1013 <td class="md" nowrap>std::string </td>
1014 <td class="mdname" nowrap> <em>nickname</em></td>
1018 <td class="md">) </td>
1019 <td class="md" colspan="2"><code> [virtual]</code></td>
1026 <table cellspacing=5 cellpadding=0 border=0>
1034 Forces a user nickchange.
1036 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.
1038 Definition at line <a class="el" href="modules_8cpp-source.html#l00412">412</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1040 <div class="fragment"><pre>00413 {
1041 00414 force_nickchange(user,nickname.c_str());
1046 <a name="a18" doxytag="Server::ChanMode"></a><p>
1047 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1050 <table cellpadding="0" cellspacing="0" border="0">
1052 <td class="md" nowrap valign="top"> std::string Server::ChanMode </td>
1053 <td class="md" valign="top">( </td>
1054 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1055 <td class="mdname" nowrap> <em>User</em>, </td>
1060 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
1061 <td class="mdname" nowrap> <em>Chan</em></td>
1065 <td class="md">) </td>
1066 <td class="md" colspan="2"><code> [virtual]</code></td>
1073 <table cellspacing=5 cellpadding=0 border=0>
1081 Attempts to look up a user's privilages on a channel.
1083 This function will return a string containing either @, , +, or an empty string, representing the user's privilages upon the channel you specify.
1085 Definition at line <a class="el" href="modules_8cpp-source.html#l00545">545</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1087 References <a class="el" href="message_8h.html#a12">cmode()</a>.
1089 <div class="fragment"><pre>00546 {
1090 00547 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a12">cmode</a>(User,Chan);
1095 <a name="a10" doxytag="Server::CommonChannels"></a><p>
1096 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1099 <table cellpadding="0" cellspacing="0" border="0">
1101 <td class="md" nowrap valign="top"> bool Server::CommonChannels </td>
1102 <td class="md" valign="top">( </td>
1103 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1104 <td class="mdname" nowrap> <em>u1</em>, </td>
1109 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
1110 <td class="mdname" nowrap> <em>u2</em></td>
1114 <td class="md">) </td>
1115 <td class="md" colspan="2"><code> [virtual]</code></td>
1122 <table cellspacing=5 cellpadding=0 border=0>
1130 Returns true if two users share a common channel.
1132 This method is used internally by the NICK and QUIT commands, and the <a class="el" href="classServer.html#a11">Server::SendCommon</a> method.
1134 Definition at line <a class="el" href="modules_8cpp-source.html#l00493">493</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1136 References <a class="el" href="message_8h.html#a0">common_channels()</a>.
1138 <div class="fragment"><pre>00494 {
1139 00495 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a0">common_channels</a>(u1,u2) != 0);
1144 <a name="a14" doxytag="Server::CountUsers"></a><p>
1145 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1148 <table cellpadding="0" cellspacing="0" border="0">
1150 <td class="md" nowrap valign="top"> int Server::CountUsers </td>
1151 <td class="md" valign="top">( </td>
1152 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
1153 <td class="mdname1" valign="top" nowrap> <em>c</em> </td>
1154 <td class="md" valign="top"> ) </td>
1155 <td class="md" nowrap><code> [virtual]</code></td>
1162 <table cellspacing=5 cellpadding=0 border=0>
1170 Returns a count of the number of users on a channel.
1172 This will NEVER be 0, as if the chanrec exists, it will have at least one user in the channel.
1174 Definition at line <a class="el" href="modules_8cpp-source.html#l00613">613</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1176 <div class="fragment"><pre>00614 {
1177 00615 <span class="keywordflow">return</span> usercount(c);
1182 <a name="a50" doxytag="Server::DelELine"></a><p>
1183 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1186 <table cellpadding="0" cellspacing="0" border="0">
1188 <td class="md" nowrap valign="top"> bool Server::DelELine </td>
1189 <td class="md" valign="top">( </td>
1190 <td class="md" nowrap valign="top">std::string </td>
1191 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1192 <td class="md" valign="top"> ) </td>
1193 <td class="md" nowrap><code> [virtual]</code></td>
1200 <table cellspacing=5 cellpadding=0 border=0>
1208 Deletes a local E-Line.
1212 Definition at line <a class="el" href="modules_8cpp-source.html#l00724">724</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1214 References <a class="el" href="xline_8h.html#a10">del_eline()</a>.
1216 <div class="fragment"><pre>00725 {
1217 00726 <a class="code" href="xline_8h.html#a10">del_eline</a>(hostmask.c_str());
1222 <a name="a46" doxytag="Server::DelGLine"></a><p>
1223 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1226 <table cellpadding="0" cellspacing="0" border="0">
1228 <td class="md" nowrap valign="top"> bool Server::DelGLine </td>
1229 <td class="md" valign="top">( </td>
1230 <td class="md" nowrap valign="top">std::string </td>
1231 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1232 <td class="md" valign="top"> ) </td>
1233 <td class="md" nowrap><code> [virtual]</code></td>
1240 <table cellspacing=5 cellpadding=0 border=0>
1248 Deletes a G-Line from all servers on the mesh.
1252 Definition at line <a class="el" href="modules_8cpp-source.html#l00704">704</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1254 References <a class="el" href="xline_8h.html#a6">del_gline()</a>.
1256 <div class="fragment"><pre>00705 {
1257 00706 <a class="code" href="xline_8h.html#a6">del_gline</a>(hostmask.c_str());
1262 <a name="a49" doxytag="Server::DelKLine"></a><p>
1263 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1266 <table cellpadding="0" cellspacing="0" border="0">
1268 <td class="md" nowrap valign="top"> bool Server::DelKLine </td>
1269 <td class="md" valign="top">( </td>
1270 <td class="md" nowrap valign="top">std::string </td>
1271 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1272 <td class="md" valign="top"> ) </td>
1273 <td class="md" nowrap><code> [virtual]</code></td>
1280 <table cellspacing=5 cellpadding=0 border=0>
1288 Deletes a local K-Line.
1292 Definition at line <a class="el" href="modules_8cpp-source.html#l00719">719</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1294 References <a class="el" href="xline_8h.html#a9">del_kline()</a>.
1296 <div class="fragment"><pre>00720 {
1297 00721 <a class="code" href="xline_8h.html#a9">del_kline</a>(hostmask.c_str());
1302 <a name="a47" doxytag="Server::DelQLine"></a><p>
1303 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1306 <table cellpadding="0" cellspacing="0" border="0">
1308 <td class="md" nowrap valign="top"> bool Server::DelQLine </td>
1309 <td class="md" valign="top">( </td>
1310 <td class="md" nowrap valign="top">std::string </td>
1311 <td class="mdname1" valign="top" nowrap> <em>nickname</em> </td>
1312 <td class="md" valign="top"> ) </td>
1313 <td class="md" nowrap><code> [virtual]</code></td>
1320 <table cellspacing=5 cellpadding=0 border=0>
1328 Deletes a Q-Line from all servers on the mesh.
1332 Definition at line <a class="el" href="modules_8cpp-source.html#l00709">709</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1334 References <a class="el" href="xline_8h.html#a7">del_qline()</a>.
1336 <div class="fragment"><pre>00710 {
1337 00711 <a class="code" href="xline_8h.html#a7">del_qline</a>(nickname.c_str());
1342 <a name="a48" doxytag="Server::DelZLine"></a><p>
1343 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1346 <table cellpadding="0" cellspacing="0" border="0">
1348 <td class="md" nowrap valign="top"> bool Server::DelZLine </td>
1349 <td class="md" valign="top">( </td>
1350 <td class="md" nowrap valign="top">std::string </td>
1351 <td class="mdname1" valign="top" nowrap> <em>ipaddr</em> </td>
1352 <td class="md" valign="top"> ) </td>
1353 <td class="md" nowrap><code> [virtual]</code></td>
1360 <table cellspacing=5 cellpadding=0 border=0>
1368 Deletes a Z-Line from all servers on the mesh.
1372 Definition at line <a class="el" href="modules_8cpp-source.html#l00714">714</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1374 References <a class="el" href="xline_8h.html#a8">del_zline()</a>.
1376 <div class="fragment"><pre>00715 {
1377 00716 <a class="code" href="xline_8h.html#a8">del_zline</a>(ipaddr.c_str());
1382 <a name="a17" doxytag="Server::FindChannel"></a><p>
1383 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1386 <table cellpadding="0" cellspacing="0" border="0">
1388 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::FindChannel </td>
1389 <td class="md" valign="top">( </td>
1390 <td class="md" nowrap valign="top">std::string </td>
1391 <td class="mdname1" valign="top" nowrap> <em>channel</em> </td>
1392 <td class="md" valign="top"> ) </td>
1393 <td class="md" nowrap><code> [virtual]</code></td>
1400 <table cellspacing=5 cellpadding=0 border=0>
1408 Attempts to look up a channel and return a pointer to it.
1410 This function will return NULL if the channel does not exist.
1412 Definition at line <a class="el" href="modules_8cpp-source.html#l00540">540</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1414 <div class="fragment"><pre>00541 {
1415 00542 <span class="keywordflow">return</span> FindChan(channel.c_str());
1420 <a name="a16" doxytag="Server::FindDescriptor"></a><p>
1421 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1424 <table cellpadding="0" cellspacing="0" border="0">
1426 <td class="md" nowrap valign="top"> <a class="el" href="classuserrec.html">userrec</a> * Server::FindDescriptor </td>
1427 <td class="md" valign="top">( </td>
1428 <td class="md" nowrap valign="top">int </td>
1429 <td class="mdname1" valign="top" nowrap> <em>socket</em> </td>
1430 <td class="md" valign="top"> ) </td>
1431 <td class="md" nowrap><code> [virtual]</code></td>
1438 <table cellspacing=5 cellpadding=0 border=0>
1446 Attempts to look up a nick using the file descriptor associated with that nick.
1448 This function will return NULL if the file descriptor is not associated with a valid user.
1450 Definition at line <a class="el" href="modules_8cpp-source.html#l00535">535</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1452 References <a class="el" href="modules_8cpp-source.html#l00116">fd_ref_table</a>.
1454 <div class="fragment"><pre>00536 {
1455 00537 <span class="keywordflow">return</span> (socket < 65536 ? <a class="code" href="modules_8cpp.html#a36">fd_ref_table</a>[socket] : NULL);
1460 <a name="a60" doxytag="Server::FindModule"></a><p>
1461 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1464 <table cellpadding="0" cellspacing="0" border="0">
1466 <td class="md" nowrap valign="top"> <a class="el" href="classModule.html">Module</a> * Server::FindModule </td>
1467 <td class="md" valign="top">( </td>
1468 <td class="md" nowrap valign="top">std::string </td>
1469 <td class="mdname1" valign="top" nowrap> <em>name</em> </td>
1470 <td class="md" valign="top"> ) </td>
1471 <td class="md" nowrap><code> [virtual]</code></td>
1478 <table cellspacing=5 cellpadding=0 border=0>
1486 This function finds a module by name.
1488 You must provide the filename of the module. If the module cannot be found (is not loaded) the function will return NULL.
1490 Definition at line <a class="el" href="modules_8cpp-source.html#l00807">807</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1492 References <a class="el" href="modules_8cpp-source.html#l01016">MODCOUNT</a>, <a class="el" href="channels_8cpp-source.html#l00086">module_names</a>, and <a class="el" href="channels_8cpp-source.html#l00059">modules</a>.
1494 <div class="fragment"><pre>00808 {
1495 00809 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i <= <a class="code" href="modules_8cpp.html#a1">MODCOUNT</a>; i++)
1497 00811 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#a26">module_names</a>[i] == name)
1499 00813 <span class="keywordflow">return</span> <a class="code" href="channels_8cpp.html#a2">modules</a>[i];
1502 00816 <span class="keywordflow">return</span> NULL;
1507 <a name="a15" doxytag="Server::FindNick"></a><p>
1508 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1511 <table cellpadding="0" cellspacing="0" border="0">
1513 <td class="md" nowrap valign="top"> <a class="el" href="classuserrec.html">userrec</a> * Server::FindNick </td>
1514 <td class="md" valign="top">( </td>
1515 <td class="md" nowrap valign="top">std::string </td>
1516 <td class="mdname1" valign="top" nowrap> <em>nick</em> </td>
1517 <td class="md" valign="top"> ) </td>
1518 <td class="md" nowrap><code> [virtual]</code></td>
1525 <table cellspacing=5 cellpadding=0 border=0>
1533 Attempts to look up a nick and return a pointer to it.
1535 This function will return NULL if the nick does not exist.
1537 Definition at line <a class="el" href="modules_8cpp-source.html#l00530">530</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1539 <div class="fragment"><pre>00531 {
1540 00532 <span class="keywordflow">return</span> Find(nick);
1545 <a name="a23" doxytag="Server::GetAdmin"></a><p>
1546 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1549 <table cellpadding="0" cellspacing="0" border="0">
1551 <td class="md" nowrap valign="top"> <a class="el" href="classAdmin.html">Admin</a> Server::GetAdmin </td>
1552 <td class="md" valign="top">( </td>
1553 <td class="mdname1" valign="top" nowrap> </td>
1554 <td class="md" valign="top"> ) </td>
1555 <td class="md" nowrap><code> [virtual]</code></td>
1562 <table cellspacing=5 cellpadding=0 border=0>
1570 Returns the information of the server as returned by the /ADMIN command.
1572 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.
1574 Definition at line <a class="el" href="modules_8cpp-source.html#l00570">570</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1576 <div class="fragment"><pre>00571 {
1577 00572 <span class="keywordflow">return</span> <a class="code" href="classAdmin.html">Admin</a>(getadminname(),getadminemail(),getadminnick());
1582 <a name="a21" doxytag="Server::GetNetworkName"></a><p>
1583 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1586 <table cellpadding="0" cellspacing="0" border="0">
1588 <td class="md" nowrap valign="top"> std::string Server::GetNetworkName </td>
1589 <td class="md" valign="top">( </td>
1590 <td class="mdname1" valign="top" nowrap> </td>
1591 <td class="md" valign="top"> ) </td>
1592 <td class="md" nowrap><code> [virtual]</code></td>
1599 <table cellspacing=5 cellpadding=0 border=0>
1607 Returns the network name, global to all linked servers.
1611 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>.
1613 <div class="fragment"><pre>00561 {
1614 00562 <span class="keywordflow">return</span> getnetworkname();
1619 <a name="a22" doxytag="Server::GetServerDescription"></a><p>
1620 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1623 <table cellpadding="0" cellspacing="0" border="0">
1625 <td class="md" nowrap valign="top"> std::string Server::GetServerDescription </td>
1626 <td class="md" valign="top">( </td>
1627 <td class="mdname1" valign="top" nowrap> </td>
1628 <td class="md" valign="top"> ) </td>
1629 <td class="md" nowrap><code> [virtual]</code></td>
1636 <table cellspacing=5 cellpadding=0 border=0>
1644 Returns the server description string of the local server.
1648 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>.
1650 <div class="fragment"><pre>00566 {
1651 00567 <span class="keywordflow">return</span> getserverdesc();
1656 <a name="a20" doxytag="Server::GetServerName"></a><p>
1657 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1660 <table cellpadding="0" cellspacing="0" border="0">
1662 <td class="md" nowrap valign="top"> std::string Server::GetServerName </td>
1663 <td class="md" valign="top">( </td>
1664 <td class="mdname1" valign="top" nowrap> </td>
1665 <td class="md" valign="top"> ) </td>
1666 <td class="md" nowrap><code> [virtual]</code></td>
1673 <table cellspacing=5 cellpadding=0 border=0>
1681 Returns the server name of the server where the module is loaded.
1685 Definition at line <a class="el" href="modules_8cpp-source.html#l00555">555</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1687 <div class="fragment"><pre>00556 {
1688 00557 <span class="keywordflow">return</span> getservername();
1693 <a name="a38" doxytag="Server::GetUsers"></a><p>
1694 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1697 <table cellpadding="0" cellspacing="0" border="0">
1699 <td class="md" nowrap valign="top"> <a class="el" href="modules_8h.html#a33">chanuserlist</a> Server::GetUsers </td>
1700 <td class="md" valign="top">( </td>
1701 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
1702 <td class="mdname1" valign="top" nowrap> <em>chan</em> </td>
1703 <td class="md" valign="top"> ) </td>
1704 <td class="md" nowrap><code> [virtual]</code></td>
1711 <table cellspacing=5 cellpadding=0 border=0>
1719 Fetches the userlist of a channel.
1721 This function must be here and not a member of userrec or chanrec due to include constraints.
1723 Definition at line <a class="el" href="modules_8cpp-source.html#l00400">400</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1725 References <a class="el" href="modules_8h-source.html#l00072">chanuserlist</a>, <a class="el" href="channels_8cpp-source.html#l00221">chanrec::GetUsers()</a>, and <a class="el" href="channels_8cpp-source.html#l00073">list</a>.
1727 <div class="fragment"><pre>00401 {
1728 00402 <a class="code" href="modules_8h.html#a33">chanuserlist</a> userl;
1729 00403 userl.clear();
1730 00404 std::vector<char*> *<a class="code" href="channels_8cpp.html#a15">list</a> = chan-><a class="code" href="classchanrec.html#a7">GetUsers</a>();
1731 00405 <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++)
1733 00407 <span class="keywordtype">char</span>* o = *i;
1734 00408 userl.push_back((<a class="code" href="classuserrec.html">userrec</a>*)o);
1736 00410 <span class="keywordflow">return</span> userl;
1741 <a name="a13" doxytag="Server::IsNick"></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::IsNick </td>
1748 <td class="md" valign="top">( </td>
1749 <td class="md" nowrap valign="top">std::string </td>
1750 <td class="mdname1" valign="top" nowrap> <em>nick</em> </td>
1751 <td class="md" valign="top"> ) </td>
1752 <td class="md" nowrap><code> [virtual]</code></td>
1759 <table cellspacing=5 cellpadding=0 border=0>
1767 Returns true if a nick is valid.
1769 Nicks for unregistered connections will return false.
1771 Definition at line <a class="el" href="modules_8cpp-source.html#l00525">525</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1773 References <a class="el" href="message_8h.html#a11">isnick()</a>.
1775 <div class="fragment"><pre>00526 {
1776 00527 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a11">isnick</a>(nick.c_str()) != 0);
1781 <a name="a19" doxytag="Server::IsOnChannel"></a><p>
1782 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1785 <table cellpadding="0" cellspacing="0" border="0">
1787 <td class="md" nowrap valign="top"> bool Server::IsOnChannel </td>
1788 <td class="md" valign="top">( </td>
1789 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1790 <td class="mdname" nowrap> <em>User</em>, </td>
1795 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
1796 <td class="mdname" nowrap> <em>Chan</em></td>
1800 <td class="md">) </td>
1801 <td class="md" colspan="2"><code> [virtual]</code></td>
1808 <table cellspacing=5 cellpadding=0 border=0>
1816 Checks if a user is on a channel.
1818 This function will return true or false to indicate if user 'User' is on channel 'Chan'.
1820 Definition at line <a class="el" href="modules_8cpp-source.html#l00550">550</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1822 References <a class="el" href="message_8h.html#a14">has_channel()</a>.
1824 <div class="fragment"><pre>00551 {
1825 00552 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a14">has_channel</a>(User,Chan);
1830 <a name="a37" doxytag="Server::IsUlined"></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::IsUlined </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>server</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 the servername you give is ulined.
1858 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.
1860 Definition at line <a class="el" href="modules_8cpp-source.html#l00422">422</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1862 References <a class="el" href="commands_8h.html#a75">is_uline()</a>.
1864 <div class="fragment"><pre>00423 {
1865 00424 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a75">is_uline</a>(server.c_str());
1870 <a name="a52" doxytag="Server::IsValidMask"></a><p>
1871 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1874 <table cellpadding="0" cellspacing="0" border="0">
1876 <td class="md" nowrap valign="top"> bool Server::IsValidMask </td>
1877 <td class="md" valign="top">( </td>
1878 <td class="md" nowrap valign="top">std::string </td>
1879 <td class="mdname1" valign="top" nowrap> <em>mask</em> </td>
1880 <td class="md" valign="top"> ) </td>
1881 <td class="md" nowrap><code> [virtual]</code></td>
1888 <table cellspacing=5 cellpadding=0 border=0>
1896 Returns true if a nick!ident string is correctly formatted, false if otherwise.
1900 Definition at line <a class="el" href="modules_8cpp-source.html#l00734">734</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1902 <div class="fragment"><pre>00735 {
1903 00736 <span class="keyword">const</span> <span class="keywordtype">char</span>* dest = mask.c_str();
1904 00737 <span class="keywordflow">if</span> (strchr(dest,<span class="charliteral">'!'</span>)==0)
1905 00738 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1906 00739 <span class="keywordflow">if</span> (strchr(dest,<span class="charliteral">'@'</span>)==0)
1907 00740 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1908 00741 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1909 00742 <span class="keywordflow">if</span> (dest[i] < 32)
1910 00743 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1911 00744 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1912 00745 <span class="keywordflow">if</span> (dest[i] > 126)
1913 00746 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1914 00747 <span class="keywordtype">int</span> c = 0;
1915 00748 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1916 00749 <span class="keywordflow">if</span> (dest[i] == <span class="charliteral">'!'</span>)
1918 00751 <span class="keywordflow">if</span> (c>1)
1919 00752 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1921 00754 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1922 00755 <span class="keywordflow">if</span> (dest[i] == <span class="charliteral">'@'</span>)
1924 00757 <span class="keywordflow">if</span> (c>1)
1925 00758 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1927 00760 <span class="keywordflow">return</span> <span class="keyword">true</span>;
1932 <a name="a29" doxytag="Server::JoinUserToChannel"></a><p>
1933 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1936 <table cellpadding="0" cellspacing="0" border="0">
1938 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::JoinUserToChannel </td>
1939 <td class="md" valign="top">( </td>
1940 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1941 <td class="mdname" nowrap> <em>user</em>, </td>
1946 <td class="md" nowrap>std::string </td>
1947 <td class="mdname" nowrap> <em>cname</em>, </td>
1952 <td class="md" nowrap>std::string </td>
1953 <td class="mdname" nowrap> <em>key</em></td>
1957 <td class="md">) </td>
1958 <td class="md" colspan="2"><code> [virtual]</code></td>
1965 <table cellspacing=5 cellpadding=0 border=0>
1973 Forces a user to join a channel.
1975 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.
1977 Definition at line <a class="el" href="modules_8cpp-source.html#l00390">390</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1979 <div class="fragment"><pre>00391 {
1980 00392 <span class="keywordflow">return</span> add_channel(user,cname.c_str(),key.c_str(),<span class="keyword">false</span>);
1985 <a name="a3" doxytag="Server::Log"></a><p>
1986 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1989 <table cellpadding="0" cellspacing="0" border="0">
1991 <td class="md" nowrap valign="top"> void Server::Log </td>
1992 <td class="md" valign="top">( </td>
1993 <td class="md" nowrap valign="top">int </td>
1994 <td class="mdname" nowrap> <em>level</em>, </td>
1999 <td class="md" nowrap>std::string </td>
2000 <td class="mdname" nowrap> <em>s</em></td>
2004 <td class="md">) </td>
2005 <td class="md" colspan="2"><code> [virtual]</code></td>
2012 <table cellspacing=5 cellpadding=0 border=0>
2020 Writes a log string.
2022 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.
2024 Definition at line <a class="el" href="modules_8cpp-source.html#l00432">432</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2026 <div class="fragment"><pre>00433 {
2027 00434 log(level,<span class="stringliteral">"%s"</span>,s.c_str());
2032 <a name="a33" doxytag="Server::MatchText"></a><p>
2033 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2036 <table cellpadding="0" cellspacing="0" border="0">
2038 <td class="md" nowrap valign="top"> bool Server::MatchText </td>
2039 <td class="md" valign="top">( </td>
2040 <td class="md" nowrap valign="top">std::string </td>
2041 <td class="mdname" nowrap> <em>sliteral</em>, </td>
2046 <td class="md" nowrap>std::string </td>
2047 <td class="mdname" nowrap> <em>spattern</em></td>
2051 <td class="md">) </td>
2052 <td class="md" colspan="2"><code> [virtual]</code></td>
2059 <table cellspacing=5 cellpadding=0 border=0>
2067 Matches text against a glob pattern.
2069 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.
2071 Definition at line <a class="el" href="modules_8cpp-source.html#l00377">377</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2073 <div class="fragment"><pre>00378 {
2074 00379 <span class="keywordtype">char</span> literal[MAXBUF],pattern[MAXBUF];
2075 00380 strlcpy(literal,sliteral.c_str(),MAXBUF);
2076 00381 strlcpy(pattern,spattern.c_str(),MAXBUF);
2077 00382 <span class="keywordflow">return</span> match(literal,pattern);
2082 <a name="a58" doxytag="Server::MeshCheckChan"></a><p>
2083 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2086 <table cellpadding="0" cellspacing="0" border="0">
2088 <td class="md" nowrap valign="top"> bool Server::MeshCheckChan </td>
2089 <td class="md" valign="top">( </td>
2090 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
2091 <td class="mdname" nowrap> <em>c</em>, </td>
2096 <td class="md" nowrap>std::string </td>
2097 <td class="mdname" nowrap> <em>servername</em></td>
2101 <td class="md">) </td>
2102 <td class="md" colspan="2"><code> [virtual]</code></td>
2109 <table cellspacing=5 cellpadding=0 border=0>
2117 This function is used to check if any users on channel c are on server servername.
2119 This is used internally by PRIVMSG etc. You should not need to use it.
2121 Definition at line <a class="el" href="modules_8cpp-source.html#l00789">789</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2123 <div class="fragment"><pre>00790 {
2124 00791 <span class="keywordflow">if</span> (c)
2126 00793 <span class="keywordflow">return</span> ChanAnyOnThisServer(c,(<span class="keywordtype">char</span>*)servername.c_str());
2128 00795 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;
2133 <a name="a59" doxytag="Server::MeshCheckCommon"></a><p>
2134 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2137 <table cellpadding="0" cellspacing="0" border="0">
2139 <td class="md" nowrap valign="top"> bool Server::MeshCheckCommon </td>
2140 <td class="md" valign="top">( </td>
2141 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2142 <td class="mdname" nowrap> <em>u</em>, </td>
2147 <td class="md" nowrap>std::string </td>
2148 <td class="mdname" nowrap> <em>servername</em></td>
2152 <td class="md">) </td>
2153 <td class="md" colspan="2"><code> [virtual]</code></td>
2160 <table cellspacing=5 cellpadding=0 border=0>
2168 This function is used to check if user u has any channels in common with users on servername.
2170 This is used internally by <a class="el" href="classServer.html#a54">Server::MeshSendCommon</a>. You should very rarely need to use it.
2172 Definition at line <a class="el" href="modules_8cpp-source.html#l00798">798</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2174 <div class="fragment"><pre>00799 {
2175 00800 <span class="keywordflow">if</span> (u)
2177 00802 <span class="keywordflow">return</span> CommonOnThisServer(u,(<span class="keywordtype">char</span>*)servername.c_str());
2179 00804 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;
2184 <a name="a53" doxytag="Server::MeshSendAll"></a><p>
2185 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2188 <table cellpadding="0" cellspacing="0" border="0">
2190 <td class="md" nowrap valign="top"> void Server::MeshSendAll </td>
2191 <td class="md" valign="top">( </td>
2192 <td class="md" nowrap valign="top">std::string </td>
2193 <td class="mdname1" valign="top" nowrap> <em>text</em> </td>
2194 <td class="md" valign="top"> ) </td>
2195 <td class="md" nowrap><code> [virtual]</code></td>
2202 <table cellspacing=5 cellpadding=0 border=0>
2210 Sends a line of text to all connected servers.
2212 If a server is not directly reachable, the core deals with routing the message, and will also deal with failures transparently.
2214 Definition at line <a class="el" href="modules_8cpp-source.html#l00763">763</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2216 <div class="fragment"><pre>00764 {
2217 00765 NetSendToAll((<span class="keywordtype">char</span>*)text.c_str());
2222 <a name="a55" doxytag="Server::MeshSendAllAlive"></a><p>
2223 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2226 <table cellpadding="0" cellspacing="0" border="0">
2228 <td class="md" nowrap valign="top"> void Server::MeshSendAllAlive </td>
2229 <td class="md" valign="top">( </td>
2230 <td class="md" nowrap valign="top">std::string </td>
2231 <td class="mdname1" valign="top" nowrap> <em>text</em> </td>
2232 <td class="md" valign="top"> ) </td>
2233 <td class="md" nowrap><code> [virtual]</code></td>
2240 <table cellspacing=5 cellpadding=0 border=0>
2248 This function is equivalent to Server::MeshSendToAll except it will only route to servers which are directly routable.
2252 Definition at line <a class="el" href="modules_8cpp-source.html#l00774">774</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2254 <div class="fragment"><pre>00775 {
2255 00776 NetSendToAllAlive((<span class="keywordtype">char</span>*)text.c_str());
2260 <a name="a57" doxytag="Server::MeshSendAllExcept"></a><p>
2261 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2264 <table cellpadding="0" cellspacing="0" border="0">
2266 <td class="md" nowrap valign="top"> void Server::MeshSendAllExcept </td>
2267 <td class="md" valign="top">( </td>
2268 <td class="md" nowrap valign="top">std::string </td>
2269 <td class="mdname" nowrap> <em>target</em>, </td>
2274 <td class="md" nowrap>std::string </td>
2275 <td class="mdname" nowrap> <em>text</em></td>
2279 <td class="md">) </td>
2280 <td class="md" colspan="2"><code> [virtual]</code></td>
2287 <table cellspacing=5 cellpadding=0 border=0>
2295 This function sends to all servers EXCEPT the one you specify.
2297 You should usually use this function to send messages, specifying the SENDER of your message as 'target'. This will prevent message loops.
2299 Definition at line <a class="el" href="modules_8cpp-source.html#l00784">784</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2301 <div class="fragment"><pre>00785 {
2302 00786 NetSendToAllExcept(target.c_str(),(<span class="keywordtype">char</span>*)text.c_str());
2307 <a name="a54" doxytag="Server::MeshSendCommon"></a><p>
2308 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2311 <table cellpadding="0" cellspacing="0" border="0">
2313 <td class="md" nowrap valign="top"> void Server::MeshSendCommon </td>
2314 <td class="md" valign="top">( </td>
2315 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2316 <td class="mdname" nowrap> <em>user</em>, </td>
2321 <td class="md" nowrap>std::string </td>
2322 <td class="mdname" nowrap> <em>text</em></td>
2326 <td class="md">) </td>
2327 <td class="md" colspan="2"><code> [virtual]</code></td>
2334 <table cellspacing=5 cellpadding=0 border=0>
2342 This method sends a line of text to all servers who have users which share common channels with the user you provide.
2344 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!)
2346 Definition at line <a class="el" href="modules_8cpp-source.html#l00768">768</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2348 <div class="fragment"><pre>00769 {
2349 00770 <span class="keywordflow">if</span> (user)
2350 00771 NetSendToCommon(user,(<span class="keywordtype">char</span>*)text.c_str());
2355 <a name="a56" doxytag="Server::MeshSendUnicast"></a><p>
2356 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2359 <table cellpadding="0" cellspacing="0" border="0">
2361 <td class="md" nowrap valign="top"> void Server::MeshSendUnicast </td>
2362 <td class="md" valign="top">( </td>
2363 <td class="md" nowrap valign="top">std::string </td>
2364 <td class="mdname" nowrap> <em>destination</em>, </td>
2369 <td class="md" nowrap>std::string </td>
2370 <td class="mdname" nowrap> <em>text</em></td>
2374 <td class="md">) </td>
2375 <td class="md" colspan="2"><code> [virtual]</code></td>
2382 <table cellspacing=5 cellpadding=0 border=0>
2390 This function sends a line of text directly to a server.
2392 If the server is not directly routable at this time, the server attempts to route text through the mesh.
2394 Definition at line <a class="el" href="modules_8cpp-source.html#l00779">779</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2396 <div class="fragment"><pre>00780 {
2397 00781 NetSendToOne((<span class="keywordtype">char</span>*)destination.c_str(),(<span class="keywordtype">char</span>*)text.c_str());
2402 <a name="a30" doxytag="Server::PartUserFromChannel"></a><p>
2403 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2406 <table cellpadding="0" cellspacing="0" border="0">
2408 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::PartUserFromChannel </td>
2409 <td class="md" valign="top">( </td>
2410 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2411 <td class="mdname" nowrap> <em>user</em>, </td>
2416 <td class="md" nowrap>std::string </td>
2417 <td class="mdname" nowrap> <em>cname</em>, </td>
2422 <td class="md" nowrap>std::string </td>
2423 <td class="mdname" nowrap> <em>reason</em></td>
2427 <td class="md">) </td>
2428 <td class="md" colspan="2"><code> [virtual]</code></td>
2435 <table cellspacing=5 cellpadding=0 border=0>
2443 Forces a user to part a channel.
2445 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.
2447 Definition at line <a class="el" href="modules_8cpp-source.html#l00395">395</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2449 <div class="fragment"><pre>00396 {
2450 00397 <span class="keywordflow">return</span> del_channel(user,cname.c_str(),reason.c_str(),<span class="keyword">false</span>);
2455 <a name="a40" doxytag="Server::PseudoToUser"></a><p>
2456 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2459 <table cellpadding="0" cellspacing="0" border="0">
2461 <td class="md" nowrap valign="top"> bool Server::PseudoToUser </td>
2462 <td class="md" valign="top">( </td>
2463 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2464 <td class="mdname" nowrap> <em>alive</em>, </td>
2469 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2470 <td class="mdname" nowrap> <em>zombie</em>, </td>
2475 <td class="md" nowrap>std::string </td>
2476 <td class="mdname" nowrap> <em>message</em></td>
2480 <td class="md">) </td>
2481 <td class="md" colspan="2"><code> [virtual]</code></td>
2488 <table cellspacing=5 cellpadding=0 border=0>
2496 This user takes one user, and switches their file descriptor with another user, so that one user "becomes" the other.
2498 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.
2500 Definition at line <a class="el" href="modules_8cpp-source.html#l00649">649</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2502 References <a class="el" href="channels_8h-source.html#l00252">ucrec::channel</a>, <a class="el" href="users_8h-source.html#l00142">userrec::chans</a>, <a class="el" href="users_8cpp-source.html#l00224">userrec::ClearBuffer()</a>, <a class="el" href="connection_8h-source.html#l00301">connection::fd</a>, <a class="el" href="modules_8h-source.html#l00099">FD_MAGIC_NUMBER</a>, <a class="el" href="modules_8cpp-source.html#l00116">fd_ref_table</a>, <a class="el" href="connection_8h-source.html#l00305">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>.
2504 <div class="fragment"><pre>00650 {
2505 00651 zombie-><a class="code" href="classconnection.html#o0">fd</a> = alive-><a class="code" href="classconnection.html#o0">fd</a>;
2506 00652 alive-><a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="modules_8h.html#a26">FD_MAGIC_NUMBER</a>;
2507 00653 alive-><a class="code" href="classuserrec.html#a11">ClearBuffer</a>();
2508 00654 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>);
2509 00655 kill_link(alive,message.c_str());
2510 00656 <a class="code" href="modules_8cpp.html#a36">fd_ref_table</a>[zombie-><a class="code" href="classconnection.html#o0">fd</a>] = zombie;
2511 00657 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i != MAXCHANS; i++)
2513 00659 <span class="keywordflow">if</span> (zombie->chans[i].channel != NULL)
2515 00661 <span class="keywordflow">if</span> (zombie->chans[i].channel->name)
2517 00663 <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>;
2518 00664 WriteFrom(zombie->fd,zombie,<span class="stringliteral">"JOIN %s"</span>,Ptr-><a class="code" href="classchanrec.html#o0">name</a>);
2519 00665 <span class="keywordflow">if</span> (Ptr-><a class="code" href="classchanrec.html#o5">topicset</a>)
2521 00667 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>);
2522 00668 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>);
2524 00670 userlist(zombie,Ptr);
2525 00671 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>);
2535 <a name="a32" doxytag="Server::QuitUser"></a><p>
2536 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2539 <table cellpadding="0" cellspacing="0" border="0">
2541 <td class="md" nowrap valign="top"> void Server::QuitUser </td>
2542 <td class="md" valign="top">( </td>
2543 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2544 <td class="mdname" nowrap> <em>user</em>, </td>
2549 <td class="md" nowrap>std::string </td>
2550 <td class="mdname" nowrap> <em>reason</em></td>
2554 <td class="md">) </td>
2555 <td class="md" colspan="2"><code> [virtual]</code></td>
2562 <table cellspacing=5 cellpadding=0 border=0>
2570 Forces a user to quit with the specified reason.
2572 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>
2574 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.
2576 Definition at line <a class="el" href="modules_8cpp-source.html#l00417">417</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2578 <div class="fragment"><pre>00418 {
2579 00419 kill_link(user,reason.c_str());
2584 <a name="a4" doxytag="Server::Send"></a><p>
2585 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2588 <table cellpadding="0" cellspacing="0" border="0">
2590 <td class="md" nowrap valign="top"> void Server::Send </td>
2591 <td class="md" valign="top">( </td>
2592 <td class="md" nowrap valign="top">int </td>
2593 <td class="mdname" nowrap> <em>Socket</em>, </td>
2598 <td class="md" nowrap>std::string </td>
2599 <td class="mdname" nowrap> <em>s</em></td>
2603 <td class="md">) </td>
2604 <td class="md" colspan="2"><code> [virtual]</code></td>
2611 <table cellspacing=5 cellpadding=0 border=0>
2619 Sends a line of text down a TCP/IP socket.
2621 This method writes a line of text to an established socket, cutting it to 510 characters plus a carriage return and linefeed if required.
2623 Definition at line <a class="el" href="modules_8cpp-source.html#l00447">447</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2625 <div class="fragment"><pre>00448 {
2626 00449 Write(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
2631 <a name="a9" doxytag="Server::SendChannel"></a><p>
2632 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2635 <table cellpadding="0" cellspacing="0" border="0">
2637 <td class="md" nowrap valign="top"> void Server::SendChannel </td>
2638 <td class="md" valign="top">( </td>
2639 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2640 <td class="mdname" nowrap> <em>User</em>, </td>
2645 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
2646 <td class="mdname" nowrap> <em>Channel</em>, </td>
2651 <td class="md" nowrap>std::string </td>
2652 <td class="mdname" nowrap> <em>s</em>, </td>
2657 <td class="md" nowrap>bool </td>
2658 <td class="mdname" nowrap> <em>IncludeSender</em></td>
2662 <td class="md">) </td>
2663 <td class="md" colspan="2"><code> [virtual]</code></td>
2670 <table cellspacing=5 cellpadding=0 border=0>
2678 Sends text from a user to a channel (mulicast).
2680 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).
2682 Definition at line <a class="el" href="modules_8cpp-source.html#l00481">481</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2684 <div class="fragment"><pre>00482 {
2685 00483 <span class="keywordflow">if</span> (IncludeSender)
2687 00485 WriteChannel(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
2689 00487 <span class="keywordflow">else</span>
2691 00489 ChanExceptSender(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
2697 <a name="a6" doxytag="Server::SendChannelServerNotice"></a><p>
2698 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2701 <table cellpadding="0" cellspacing="0" border="0">
2703 <td class="md" nowrap valign="top"> void Server::SendChannelServerNotice </td>
2704 <td class="md" valign="top">( </td>
2705 <td class="md" nowrap valign="top">std::string </td>
2706 <td class="mdname" nowrap> <em>ServName</em>, </td>
2711 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
2712 <td class="mdname" nowrap> <em>Channel</em>, </td>
2717 <td class="md" nowrap>std::string </td>
2718 <td class="mdname" nowrap> <em>text</em></td>
2722 <td class="md">) </td>
2723 <td class="md" colspan="2"><code> [virtual]</code></td>
2730 <table cellspacing=5 cellpadding=0 border=0>
2738 Writes text to a channel, but from a server, including all.
2740 This can be used to send server notices to a group of users.
2742 Definition at line <a class="el" href="modules_8cpp-source.html#l00476">476</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2744 <div class="fragment"><pre>00477 {
2745 00478 WriteChannelWithServ((<span class="keywordtype">char</span>*)ServName.c_str(), Channel, <span class="stringliteral">"%s"</span>, text.c_str());
2750 <a name="a11" doxytag="Server::SendCommon"></a><p>
2751 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2754 <table cellpadding="0" cellspacing="0" border="0">
2756 <td class="md" nowrap valign="top"> void Server::SendCommon </td>
2757 <td class="md" valign="top">( </td>
2758 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2759 <td class="mdname" nowrap> <em>User</em>, </td>
2764 <td class="md" nowrap>std::string </td>
2765 <td class="mdname" nowrap> <em>text</em>, </td>
2770 <td class="md" nowrap>bool </td>
2771 <td class="mdname" nowrap> <em>IncludeSender</em></td>
2775 <td class="md">) </td>
2776 <td class="md" colspan="2"><code> [virtual]</code></td>
2783 <table cellspacing=5 cellpadding=0 border=0>
2791 Sends text from a user to one or more channels (mulicast).
2793 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.
2795 Definition at line <a class="el" href="modules_8cpp-source.html#l00498">498</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2797 <div class="fragment"><pre>00499 {
2798 00500 <span class="keywordflow">if</span> (IncludeSender)
2800 00502 WriteCommon(User,<span class="stringliteral">"%s"</span>,text.c_str());
2802 00504 <span class="keywordflow">else</span>
2804 00506 WriteCommonExcept(User,<span class="stringliteral">"%s"</span>,text.c_str());
2810 <a name="a7" doxytag="Server::SendFrom"></a><p>
2811 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2814 <table cellpadding="0" cellspacing="0" border="0">
2816 <td class="md" nowrap valign="top"> void Server::SendFrom </td>
2817 <td class="md" valign="top">( </td>
2818 <td class="md" nowrap valign="top">int </td>
2819 <td class="mdname" nowrap> <em>Socket</em>, </td>
2824 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2825 <td class="mdname" nowrap> <em>User</em>, </td>
2830 <td class="md" nowrap>std::string </td>
2831 <td class="mdname" nowrap> <em>s</em></td>
2835 <td class="md">) </td>
2836 <td class="md" colspan="2"><code> [virtual]</code></td>
2843 <table cellspacing=5 cellpadding=0 border=0>
2851 Sends text from a user to a socket.
2853 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)
2855 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>.
2857 <div class="fragment"><pre>00458 {
2858 00459 WriteFrom(Socket,User,<span class="stringliteral">"%s"</span>,s.c_str());
2863 <a name="a27" doxytag="Server::SendMode"></a><p>
2864 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2867 <table cellpadding="0" cellspacing="0" border="0">
2869 <td class="md" nowrap valign="top"> void Server::SendMode </td>
2870 <td class="md" valign="top">( </td>
2871 <td class="md" nowrap valign="top">char ** </td>
2872 <td class="mdname" nowrap> <em>parameters</em>, </td>
2877 <td class="md" nowrap>int </td>
2878 <td class="mdname" nowrap> <em>pcnt</em>, </td>
2883 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2884 <td class="mdname" nowrap> <em>user</em></td>
2888 <td class="md">) </td>
2889 <td class="md" colspan="2"><code> [virtual]</code></td>
2896 <table cellspacing=5 cellpadding=0 border=0>
2906 you must format the parameters array with the target, modes and parameters for those modes.<p>
2909 modes[0] = ChannelName;<p>
2911 modes[2] = user->nick;<p>
2912 Srv->SendMode(modes,3,user);<p>
2913 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!
2915 Definition at line <a class="el" href="modules_8cpp-source.html#l00442">442</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2917 References <a class="el" href="modules_8h.html#a36">server_mode()</a>.
2919 <div class="fragment"><pre>00443 {
2920 00444 <a class="code" href="modules_8h.html#a36">server_mode</a>(parameters,pcnt,user);
2925 <a name="a2" doxytag="Server::SendOpers"></a><p>
2926 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2929 <table cellpadding="0" cellspacing="0" border="0">
2931 <td class="md" nowrap valign="top"> void Server::SendOpers </td>
2932 <td class="md" valign="top">( </td>
2933 <td class="md" nowrap valign="top">std::string </td>
2934 <td class="mdname1" valign="top" nowrap> <em>s</em> </td>
2935 <td class="md" valign="top"> ) </td>
2936 <td class="md" nowrap><code> [virtual]</code></td>
2943 <table cellspacing=5 cellpadding=0 border=0>
2951 Sends text to all opers.
2953 This method sends a server notice to all opers with the usermode +s.
2955 Definition at line <a class="el" href="modules_8cpp-source.html#l00372">372</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2957 <div class="fragment"><pre>00373 {
2958 00374 WriteOpers(<span class="stringliteral">"%s"</span>,s.c_str());
2963 <a name="a5" doxytag="Server::SendServ"></a><p>
2964 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2967 <table cellpadding="0" cellspacing="0" border="0">
2969 <td class="md" nowrap valign="top"> void Server::SendServ </td>
2970 <td class="md" valign="top">( </td>
2971 <td class="md" nowrap valign="top">int </td>
2972 <td class="mdname" nowrap> <em>Socket</em>, </td>
2977 <td class="md" nowrap>std::string </td>
2978 <td class="mdname" nowrap> <em>s</em></td>
2982 <td class="md">) </td>
2983 <td class="md" colspan="2"><code> [virtual]</code></td>
2990 <table cellspacing=5 cellpadding=0 border=0>
2998 Sends text from the server to a socket.
3000 This method writes a line of text to an established socket, with the servername prepended as used by numerics (see RFC 1459)
3002 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>.
3004 <div class="fragment"><pre>00453 {
3005 00454 WriteServ(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
3010 <a name="a8" doxytag="Server::SendTo"></a><p>
3011 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3014 <table cellpadding="0" cellspacing="0" border="0">
3016 <td class="md" nowrap valign="top"> void Server::SendTo </td>
3017 <td class="md" valign="top">( </td>
3018 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
3019 <td class="mdname" nowrap> <em>Source</em>, </td>
3024 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
3025 <td class="mdname" nowrap> <em>Dest</em>, </td>
3030 <td class="md" nowrap>std::string </td>
3031 <td class="mdname" nowrap> <em>s</em></td>
3035 <td class="md">) </td>
3036 <td class="md" colspan="2"><code> [virtual]</code></td>
3043 <table cellspacing=5 cellpadding=0 border=0>
3051 Sends text from a user to another user.
3053 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>
3055 The format will become:<p>
3056 :localserver TEXT<p>
3057 Which is useful for numerics and server notices to single users, etc.
3059 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>.
3061 References <a class="el" href="connection_8h-source.html#l00301">connection::fd</a>.
3063 <div class="fragment"><pre>00463 {
3064 00464 <span class="keywordflow">if</span> (!Source)
3066 00466 <span class="comment">// if source is NULL, then the message originates from the local server</span>
3067 00467 Write(Dest-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">":%s %s"</span>,this->GetServerName().c_str(),s.c_str());
3069 00469 <span class="keywordflow">else</span>
3071 00471 <span class="comment">// otherwise it comes from the user specified</span>
3072 00472 WriteTo(Source,Dest,<span class="stringliteral">"%s"</span>,s.c_str());
3078 <a name="a28" doxytag="Server::SendToModeMask"></a><p>
3079 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3082 <table cellpadding="0" cellspacing="0" border="0">
3084 <td class="md" nowrap valign="top"> void Server::SendToModeMask </td>
3085 <td class="md" valign="top">( </td>
3086 <td class="md" nowrap valign="top">std::string </td>
3087 <td class="mdname" nowrap> <em>modes</em>, </td>
3092 <td class="md" nowrap>int </td>
3093 <td class="mdname" nowrap> <em>flags</em>, </td>
3098 <td class="md" nowrap>std::string </td>
3099 <td class="mdname" nowrap> <em>text</em></td>
3103 <td class="md">) </td>
3104 <td class="md" colspan="2"><code> [virtual]</code></td>
3111 <table cellspacing=5 cellpadding=0 border=0>
3119 Sends to all users matching a mode mask You must specify one or more usermodes as the first parameter.
3121 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>
3122 Serv->SendToModeMask("xi", WM_OR, "m00");<p>
3123 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.
3125 Definition at line <a class="el" href="modules_8cpp-source.html#l00385">385</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
3127 <div class="fragment"><pre>00386 {
3128 00387 WriteMode(modes.c_str(),flags,<span class="stringliteral">"%s"</span>,text.c_str());
3133 <a name="a12" doxytag="Server::SendWallops"></a><p>
3134 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3137 <table cellpadding="0" cellspacing="0" border="0">
3139 <td class="md" nowrap valign="top"> void Server::SendWallops </td>
3140 <td class="md" valign="top">( </td>
3141 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
3142 <td class="mdname" nowrap> <em>User</em>, </td>
3147 <td class="md" nowrap>std::string </td>
3148 <td class="mdname" nowrap> <em>text</em></td>
3152 <td class="md">) </td>
3153 <td class="md" colspan="2"><code> [virtual]</code></td>
3160 <table cellspacing=5 cellpadding=0 border=0>
3168 Sends a WALLOPS message.
3170 This method writes a WALLOPS message to all users with the +w flag, originating from the specified user.
3172 Definition at line <a class="el" href="modules_8cpp-source.html#l00510">510</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
3174 <div class="fragment"><pre>00511 {
3175 00512 WriteWallOps(User,<span class="keyword">false</span>,<span class="stringliteral">"%s"</span>,text.c_str());
3180 <a name="a39" doxytag="Server::UserToPseudo"></a><p>
3181 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3184 <table cellpadding="0" cellspacing="0" border="0">
3186 <td class="md" nowrap valign="top"> bool Server::UserToPseudo </td>
3187 <td class="md" valign="top">( </td>
3188 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
3189 <td class="mdname" nowrap> <em>user</em>, </td>
3194 <td class="md" nowrap>std::string </td>
3195 <td class="mdname" nowrap> <em>message</em></td>
3199 <td class="md">) </td>
3200 <td class="md" colspan="2"><code> [virtual]</code></td>
3207 <table cellspacing=5 cellpadding=0 border=0>
3215 Remove a user's connection to the irc server, but leave their client in existence in the user hash.
3217 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.
3219 Definition at line <a class="el" href="modules_8cpp-source.html#l00619">619</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
3221 References <a class="el" href="users_8cpp-source.html#l00224">userrec::ClearBuffer()</a>, <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, <a class="el" href="connection_8h-source.html#l00301">connection::fd</a>, <a class="el" href="modules_8h-source.html#l00099">FD_MAGIC_NUMBER</a>, <a class="el" href="connection_8h-source.html#l00305">connection::host</a>, and <a class="el" href="users_8h-source.html#l00125">userrec::ident</a>.
3223 <div class="fragment"><pre>00620 {
3224 00621 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> old_fd = user-><a class="code" href="classconnection.html#o0">fd</a>;
3225 00622 user-><a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="modules_8h.html#a26">FD_MAGIC_NUMBER</a>;
3226 00623 user-><a class="code" href="classuserrec.html#a11">ClearBuffer</a>();
3227 00624 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());
3228 00625 <span class="preprocessor">#ifdef USE_KQUEUE</span>
3229 00626 <span class="preprocessor"></span> <span class="keyword">struct </span>kevent ke;
3230 00627 EV_SET(&ke, old_fd, EVFILT_READ, EV_DELETE, 0, 0, NULL);
3231 00628 <span class="keywordtype">int</span> i = kevent(kq, &ke, 1, 0, 0, NULL);
3232 00629 <span class="keywordflow">if</span> (i == -1)
3234 00631 log(DEBUG,<span class="stringliteral">"kqueue: Failed to remove user from queue!"</span>);
3236 00633 <span class="preprocessor">#endif</span>
3237 00634 <span class="preprocessor"></span><span class="preprocessor">#ifdef USE_EPOLL</span>
3238 00635 <span class="preprocessor"></span> <span class="keyword">struct </span>epoll_event ev;
3239 00636 ev.events = EPOLLIN | EPOLLET;
3240 00637 ev.data.fd = old_fd;
3241 00638 <span class="keywordtype">int</span> i = epoll_ctl(ep, EPOLL_CTL_DEL, old_fd, &ev);
3242 00639 <span class="keywordflow">if</span> (i < 0)
3244 00641 log(DEBUG,<span class="stringliteral">"epoll: List deletion failure!"</span>);
3246 00643 <span class="preprocessor">#endif</span>
3247 00644 <span class="preprocessor"></span>
3248 00645 shutdown(old_fd,2);
3249 00646 close(old_fd);
3254 <hr>The documentation for this class was generated from the following files:<ul>
3255 <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>
3256 <hr size="1"><address style="align: right;"><small>Generated on Wed May 25 22:03:22 2005 for InspIRCd by
3257 <a href="http://www.doxygen.org/index.html">
3258 <img src="doxygen.png" alt="doxygen" align="middle" border=0 >
3259 </a>1.3.3 </small></address>