]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/module-doc/classServer.html
Added new documentation to cover ircd_connector
[user/henk/code/inspircd.git] / docs / module-doc / classServer.html
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>Server class Reference</title>
4 <link href="inspircd.css" rel="stylesheet" type="text/css">
5 </head><body>
6 <!-- Generated by Doxygen 1.3-rc3 -->
7 <center>
8 <a class="qindex" href="main.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
9 <hr><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. 
10 <a href="#_details">More...</a>
11 <p>
12 <code>#include &lt;<a class="el" href="modules_8h-source.html">modules.h</a>&gt;</code>
13 <p>
14 Inheritance diagram for Server:<p><center><img src="classServer__inherit__graph.gif" border="0" usemap="#Server__inherit__map" alt="Inheritance graph"></center>
15 <map name="Server__inherit__map">
16 <area href="classclassbase.html" shape="rect" coords="7,16,73,37" alt="">
17 </map>
18 <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>
19 <map name="Server__coll__map">
20 <area href="classclassbase.html" shape="rect" coords="7,106,73,128" alt="">
21 </map>
22 <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></td></tr>
24 <tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
25 <tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a0">Server</a> ()</td></tr>
26 <tr><td>&nbsp;</td><td><font size=-1><em>Default constructor.</em> <a href="#a0"></a><em></em></font><br><br></td></tr>
27 <tr><td nowrap align=right valign=top>virtual&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a1">~Server</a> ()</td></tr>
28 <tr><td>&nbsp;</td><td><font size=-1><em>Default destructor.</em> <a href="#a1"></a><em></em></font><br><br></td></tr>
29 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a2">SendOpers</a> (std::string s)</td></tr>
30 <tr><td>&nbsp;</td><td><font size=-1><em>Sends text to all opers.</em> <a href="#a2"></a><em></em></font><br><br></td></tr>
31 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a3">Log</a> (int level, std::string s)</td></tr>
32 <tr><td>&nbsp;</td><td><font size=-1><em>Writes a log string.</em> <a href="#a3"></a><em></em></font><br><br></td></tr>
33 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a4">Send</a> (int Socket, std::string s)</td></tr>
34 <tr><td>&nbsp;</td><td><font size=-1><em>Sends a line of text down a TCP/IP socket.</em> <a href="#a4"></a><em></em></font><br><br></td></tr>
35 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a5">SendServ</a> (int Socket, std::string s)</td></tr>
36 <tr><td>&nbsp;</td><td><font size=-1><em>Sends text from the server to a socket.</em> <a href="#a5"></a><em></em></font><br><br></td></tr>
37 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a6">SendFrom</a> (int Socket, <a class="el" href="classuserrec.html">userrec</a> *User, std::string s)</td></tr>
38 <tr><td>&nbsp;</td><td><font size=-1><em>Sends text from a user to a socket.</em> <a href="#a6"></a><em></em></font><br><br></td></tr>
39 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a7">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>
40 <tr><td>&nbsp;</td><td><font size=-1><em>Sends text from a user to another user.</em> <a href="#a7"></a><em></em></font><br><br></td></tr>
41 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a8">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>
42 <tr><td>&nbsp;</td><td><font size=-1><em>Sends text from a user to a channel (mulicast).</em> <a href="#a8"></a><em></em></font><br><br></td></tr>
43 <tr><td nowrap align=right valign=top>virtual bool&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a9">CommonChannels</a> (<a class="el" href="classuserrec.html">userrec</a> *u1, <a class="el" href="classuserrec.html">userrec</a> *u2)</td></tr>
44 <tr><td>&nbsp;</td><td><font size=-1><em>Returns true if two users share a common channel.</em> <a href="#a9"></a><em></em></font><br><br></td></tr>
45 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a10">SendCommon</a> (<a class="el" href="classuserrec.html">userrec</a> *User, std::string text, bool IncludeSender)</td></tr>
46 <tr><td>&nbsp;</td><td><font size=-1><em>Sends text from a user to one or more channels (mulicast).</em> <a href="#a10"></a><em></em></font><br><br></td></tr>
47 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a11">SendWallops</a> (<a class="el" href="classuserrec.html">userrec</a> *User, std::string text)</td></tr>
48 <tr><td>&nbsp;</td><td><font size=-1><em>Sends a WALLOPS message.</em> <a href="#a11"></a><em></em></font><br><br></td></tr>
49 <tr><td nowrap align=right valign=top>virtual bool&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a12">IsNick</a> (std::string nick)</td></tr>
50 <tr><td>&nbsp;</td><td><font size=-1><em>Returns true if a nick is valid.</em> <a href="#a12"></a><em></em></font><br><br></td></tr>
51 <tr><td nowrap align=right valign=top>virtual int&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a13">CountUsers</a> (<a class="el" href="classchanrec.html">chanrec</a> *c)</td></tr>
52 <tr><td>&nbsp;</td><td><font size=-1><em>Returns a count of the number of users on a channel.</em> <a href="#a13"></a><em></em></font><br><br></td></tr>
53 <tr><td nowrap align=right valign=top>virtual <a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a14">FindNick</a> (std::string nick)</td></tr>
54 <tr><td>&nbsp;</td><td><font size=-1><em>Attempts to look up a nick and return a pointer to it.</em> <a href="#a14"></a><em></em></font><br><br></td></tr>
55 <tr><td nowrap align=right valign=top>virtual <a class="el" href="classchanrec.html">chanrec</a> *&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a15">FindChannel</a> (std::string channel)</td></tr>
56 <tr><td>&nbsp;</td><td><font size=-1><em>Attempts to look up a channel and return a pointer to it.</em> <a href="#a15"></a><em></em></font><br><br></td></tr>
57 <tr><td nowrap align=right valign=top>virtual std::string&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a16">ChanMode</a> (<a class="el" href="classuserrec.html">userrec</a> *User, <a class="el" href="classchanrec.html">chanrec</a> *Chan)</td></tr>
58 <tr><td>&nbsp;</td><td><font size=-1><em>Attempts to look up a user's privilages on a channel.</em> <a href="#a16"></a><em></em></font><br><br></td></tr>
59 <tr><td nowrap align=right valign=top>virtual std::string&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a17">GetServerName</a> ()</td></tr>
60 <tr><td>&nbsp;</td><td><font size=-1><em>Returns the server name of the server where the module is loaded.</em> <a href="#a17"></a><em></em></font><br><br></td></tr>
61 <tr><td nowrap align=right valign=top>virtual std::string&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a18">GetNetworkName</a> ()</td></tr>
62 <tr><td>&nbsp;</td><td><font size=-1><em>Returns the network name, global to all linked servers.</em> <a href="#a18"></a><em></em></font><br><br></td></tr>
63 <tr><td nowrap align=right valign=top>virtual <a class="el" href="classAdmin.html">Admin</a>&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a19">GetAdmin</a> ()</td></tr>
64 <tr><td>&nbsp;</td><td><font size=-1><em>Returns the information of the server as returned by the /ADMIN command.</em> <a href="#a19"></a><em></em></font><br><br></td></tr>
65 <tr><td nowrap align=right valign=top>virtual bool&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a20">AddExtendedMode</a> (char modechar, int type, bool requires_oper, int params_when_on, int params_when_off)</td></tr>
66 <tr><td>&nbsp;</td><td><font size=-1><em>Adds an extended mode letter which is parsed by a module This allows modules to add extra mode letters, e.g.</em> <a href="#a20"></a><em></em></font><br><br></td></tr>
67 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a21">AddCommand</a> (char *cmd, <a class="el" href="ctables_8h.html#a0">handlerfunc</a> f, char flags, int minparams)</td></tr>
68 <tr><td>&nbsp;</td><td><font size=-1><em>Adds a command to the command table.</em> <a href="#a21"></a><em></em></font><br><br></td></tr>
69 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a22">SendMode</a> (char **parameters, int pcnt, <a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
70 <tr><td>&nbsp;</td><td><font size=-1><em>Sends a servermode.</em> <a href="#a22"></a><em></em></font><br><br></td></tr>
71 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a23">SendToModeMask</a> (std::string modes, int flags, std::string text)</td></tr>
72 <tr><td>&nbsp;</td><td><font size=-1><em>Sends to all users matching a mode mask You must specify one or more usermodes as the first parameter.</em> <a href="#a23"></a><em></em></font><br><br></td></tr>
73 <tr><td nowrap align=right valign=top>virtual <a class="el" href="classchanrec.html">chanrec</a> *&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a24">JoinUserToChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string cname, std::string key)</td></tr>
74 <tr><td>&nbsp;</td><td><font size=-1><em>Forces a user to join a channel.</em> <a href="#a24"></a><em></em></font><br><br></td></tr>
75 <tr><td nowrap align=right valign=top>virtual <a class="el" href="classchanrec.html">chanrec</a> *&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a25">PartUserFromChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string cname, std::string reason)</td></tr>
76 <tr><td>&nbsp;</td><td><font size=-1><em>Forces a user to part a channel.</em> <a href="#a25"></a><em></em></font><br><br></td></tr>
77 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a26">ChangeUserNick</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string nickname)</td></tr>
78 <tr><td>&nbsp;</td><td><font size=-1><em>Forces a user nickchange.</em> <a href="#a26"></a><em></em></font><br><br></td></tr>
79 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a27">QuitUser</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string reason)</td></tr>
80 <tr><td>&nbsp;</td><td><font size=-1><em>Forces a user to quit with the specified reason.</em> <a href="#a27"></a><em></em></font><br><br></td></tr>
81 <tr><td nowrap align=right valign=top>virtual bool&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a28">MatchText</a> (std::string sliteral, std::string spattern)</td></tr>
82 <tr><td>&nbsp;</td><td><font size=-1><em>Matches text against a glob pattern.</em> <a href="#a28"></a><em></em></font><br><br></td></tr>
83 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a29">CallCommandHandler</a> (std::string commandname, char **parameters, int pcnt, <a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
84 <tr><td>&nbsp;</td><td><font size=-1><em>Calls the handler for a command, either implemented by the core or by another module.</em> <a href="#a29"></a><em></em></font><br><br></td></tr>
85 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a30">ChangeHost</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string host)</td></tr>
86 <tr><td>&nbsp;</td><td><font size=-1><em>Change displayed hostname of a user.</em> <a href="#a30"></a><em></em></font><br><br></td></tr>
87 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a31">ChangeGECOS</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string gecos)</td></tr>
88 <tr><td>&nbsp;</td><td><font size=-1><em>Change GECOS (fullname) of a user.</em> <a href="#a31"></a><em></em></font><br><br></td></tr>
89 </table>
90 <hr><a name="_details"></a><h2>Detailed Description</h2>
91 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.
92 <p>
93 All modules should instantiate at least one copy of this class, and use its member functions to perform their tasks. 
94 <p>
95
96 <p>
97 Definition at line <a class="el" href="modules_8h-source.html#l00241">241</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2>
98 <a name="a0" doxytag="Server::Server"></a><p>
99 <table width="100%" cellpadding="2" cellspacing="0" border="0">
100   <tr>
101     <td class="md">
102       <table cellpadding="0" cellspacing="0" border="0">
103         <tr>
104           <td class="md" nowrap valign="top"> Server::Server </td>
105           <td class="md" valign="top">(&nbsp;</td>
106           <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
107           <td class="md" valign="top">)&nbsp;</td>
108           <td class="md" nowrap></td>
109         </tr>
110
111       </table>
112     </td>
113   </tr>
114 </table>
115 <table cellspacing=5 cellpadding=0 border=0>
116   <tr>
117     <td>
118       &nbsp;
119     </td>
120     <td>
121
122 <p>
123 Default constructor.
124 <p>
125 Creates a Server object.
126 <p>
127 Definition at line <a class="el" href="modules_8cpp-source.html#l00131">131</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
128 <p>
129 <div class="fragment"><pre>00132 {
130 00133 }
131 </pre></div>    </td>
132   </tr>
133 </table>
134 <a name="a1" doxytag="Server::~Server"></a><p>
135 <table width="100%" cellpadding="2" cellspacing="0" border="0">
136   <tr>
137     <td class="md">
138       <table cellpadding="0" cellspacing="0" border="0">
139         <tr>
140           <td class="md" nowrap valign="top"> Server::~Server </td>
141           <td class="md" valign="top">(&nbsp;</td>
142           <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
143           <td class="md" valign="top">)&nbsp;</td>
144           <td class="md" nowrap><code> [virtual]</code></td>
145         </tr>
146
147       </table>
148     </td>
149   </tr>
150 </table>
151 <table cellspacing=5 cellpadding=0 border=0>
152   <tr>
153     <td>
154       &nbsp;
155     </td>
156     <td>
157
158 <p>
159 Default destructor.
160 <p>
161 Destroys a Server object.
162 <p>
163 Definition at line <a class="el" href="modules_8cpp-source.html#l00135">135</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
164 <p>
165 <div class="fragment"><pre>00136 {
166 00137 }
167 </pre></div>    </td>
168   </tr>
169 </table>
170 <hr><h2>Member Function Documentation</h2>
171 <a name="a21" doxytag="Server::AddCommand"></a><p>
172 <table width="100%" cellpadding="2" cellspacing="0" border="0">
173   <tr>
174     <td class="md">
175       <table cellpadding="0" cellspacing="0" border="0">
176         <tr>
177           <td class="md" nowrap valign="top"> void Server::AddCommand </td>
178           <td class="md" valign="top">(&nbsp;</td>
179           <td class="md" nowrap valign="top">char *&nbsp;</td>
180           <td class="mdname" nowrap>&nbsp; <em>cmd</em>, </td>
181         </tr>
182         <tr>
183           <td></td>
184           <td></td>
185           <td class="md" nowrap><a class="el" href="ctables_8h.html#a0">handlerfunc</a>&nbsp;</td>
186           <td class="mdname" nowrap>&nbsp; <em>f</em>, </td>
187         </tr>
188         <tr>
189           <td></td>
190           <td></td>
191           <td class="md" nowrap>char&nbsp;</td>
192           <td class="mdname" nowrap>&nbsp; <em>flags</em>, </td>
193         </tr>
194         <tr>
195           <td></td>
196           <td></td>
197           <td class="md" nowrap>int&nbsp;</td>
198           <td class="mdname" nowrap>&nbsp; <em>minparams</em></td>
199         </tr>
200         <tr>
201           <td></td>
202           <td class="md">)&nbsp;</td>
203           <td class="md" colspan="2"><code> [virtual]</code></td>
204         </tr>
205
206       </table>
207     </td>
208   </tr>
209 </table>
210 <table cellspacing=5 cellpadding=0 border=0>
211   <tr>
212     <td>
213       &nbsp;
214     </td>
215     <td>
216
217 <p>
218 Adds a command to the command table.
219 <p>
220 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>
221 typedef void (handlerfunc) (char**, int, userrec*); ... void handle_kill(char **parameters, int pcnt, userrec *user)<p>
222 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'.
223 <p>
224 Definition at line <a class="el" href="modules_8cpp-source.html#l00188">188</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
225 <p>
226 References <a class="el" href="modules_8h.html#a13">createcommand()</a>.
227 <p>
228 <div class="fragment"><pre>00189 {
229 00190         <a class="code" href="modules_8h.html#a13">createcommand</a>(cmd,f,flags,minparams);
230 00191 }
231 </pre></div>    </td>
232   </tr>
233 </table>
234 <a name="a20" doxytag="Server::AddExtendedMode"></a><p>
235 <table width="100%" cellpadding="2" cellspacing="0" border="0">
236   <tr>
237     <td class="md">
238       <table cellpadding="0" cellspacing="0" border="0">
239         <tr>
240           <td class="md" nowrap valign="top"> bool Server::AddExtendedMode </td>
241           <td class="md" valign="top">(&nbsp;</td>
242           <td class="md" nowrap valign="top">char&nbsp;</td>
243           <td class="mdname" nowrap>&nbsp; <em>modechar</em>, </td>
244         </tr>
245         <tr>
246           <td></td>
247           <td></td>
248           <td class="md" nowrap>int&nbsp;</td>
249           <td class="mdname" nowrap>&nbsp; <em>type</em>, </td>
250         </tr>
251         <tr>
252           <td></td>
253           <td></td>
254           <td class="md" nowrap>bool&nbsp;</td>
255           <td class="mdname" nowrap>&nbsp; <em>requires_oper</em>, </td>
256         </tr>
257         <tr>
258           <td></td>
259           <td></td>
260           <td class="md" nowrap>int&nbsp;</td>
261           <td class="mdname" nowrap>&nbsp; <em>params_when_on</em>, </td>
262         </tr>
263         <tr>
264           <td></td>
265           <td></td>
266           <td class="md" nowrap>int&nbsp;</td>
267           <td class="mdname" nowrap>&nbsp; <em>params_when_off</em></td>
268         </tr>
269         <tr>
270           <td></td>
271           <td class="md">)&nbsp;</td>
272           <td class="md" colspan="2"><code> [virtual]</code></td>
273         </tr>
274
275       </table>
276     </td>
277   </tr>
278 </table>
279 <table cellspacing=5 cellpadding=0 border=0>
280   <tr>
281     <td>
282       &nbsp;
283     </td>
284     <td>
285
286 <p>
287 Adds an extended mode letter which is parsed by a module This allows modules to add extra mode letters, e.g.
288 <p>
289 +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.
290 <p>
291 Definition at line <a class="el" href="modules_8cpp-source.html#l00308">308</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
292 <p>
293 References <a class="el" href="modules_8cpp-source.html#l00090">DoAddExtendedMode()</a>, <a class="el" href="modules_8h-source.html#l00018">MT_CLIENT</a>, and <a class="el" href="modules_8h-source.html#l00019">MT_SERVER</a>.
294 <p>
295 <div class="fragment"><pre>00309 {
296 00310         <span class="keywordflow">if</span> (type == <a class="code" href="modules_8h.html#a7">MT_SERVER</a>)
297 00311         {
298 00312                 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion"</span>);
299 00313                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
300 00314         }
301 00315         <span class="keywordflow">if</span> (((params_when_on&gt;0) || (params_when_off&gt;0)) &amp;&amp; (type == <a class="code" href="modules_8h.html#a6">MT_CLIENT</a>))
302 00316         {
303 00317                 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Parameters on MT_CLIENT modes are not supported"</span>);
304 00318                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
305 00319         }
306 00320         <span class="keywordflow">if</span> ((params_when_on&gt;1) || (params_when_off&gt;1))
307 00321         {
308 00322                 log(DEBUG,<span class="stringliteral">"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported"</span>);
309 00323                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
310 00324         }
311 00325         <span class="keywordflow">return</span> <a class="code" href="modules_8cpp.html#a8">DoAddExtendedMode</a>(modechar,type,requires_oper,params_when_on,params_when_off);
312 00326 }
313 </pre></div>    </td>
314   </tr>
315 </table>
316 <a name="a29" doxytag="Server::CallCommandHandler"></a><p>
317 <table width="100%" cellpadding="2" cellspacing="0" border="0">
318   <tr>
319     <td class="md">
320       <table cellpadding="0" cellspacing="0" border="0">
321         <tr>
322           <td class="md" nowrap valign="top"> void Server::CallCommandHandler </td>
323           <td class="md" valign="top">(&nbsp;</td>
324           <td class="md" nowrap valign="top">std::string&nbsp;</td>
325           <td class="mdname" nowrap>&nbsp; <em>commandname</em>, </td>
326         </tr>
327         <tr>
328           <td></td>
329           <td></td>
330           <td class="md" nowrap>char **&nbsp;</td>
331           <td class="mdname" nowrap>&nbsp; <em>parameters</em>, </td>
332         </tr>
333         <tr>
334           <td></td>
335           <td></td>
336           <td class="md" nowrap>int&nbsp;</td>
337           <td class="mdname" nowrap>&nbsp; <em>pcnt</em>, </td>
338         </tr>
339         <tr>
340           <td></td>
341           <td></td>
342           <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
343           <td class="mdname" nowrap>&nbsp; <em>user</em></td>
344         </tr>
345         <tr>
346           <td></td>
347           <td class="md">)&nbsp;</td>
348           <td class="md" colspan="2"><code> [virtual]</code></td>
349         </tr>
350
351       </table>
352     </td>
353   </tr>
354 </table>
355 <table cellspacing=5 cellpadding=0 border=0>
356   <tr>
357     <td>
358       &nbsp;
359     </td>
360     <td>
361
362 <p>
363 Calls the handler for a command, either implemented by the core or by another module.
364 <p>
365 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>
366 ) 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#a21">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.
367 <p>
368 Definition at line <a class="el" href="modules_8cpp-source.html#l00178">178</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
369 <p>
370 <div class="fragment"><pre>00179 {
371 00180         call_handler(commandname.c_str(),parameters,pcnt,user);
372 00181 }
373 </pre></div>    </td>
374   </tr>
375 </table>
376 <a name="a31" doxytag="Server::ChangeGECOS"></a><p>
377 <table width="100%" cellpadding="2" cellspacing="0" border="0">
378   <tr>
379     <td class="md">
380       <table cellpadding="0" cellspacing="0" border="0">
381         <tr>
382           <td class="md" nowrap valign="top"> void Server::ChangeGECOS </td>
383           <td class="md" valign="top">(&nbsp;</td>
384           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
385           <td class="mdname" nowrap>&nbsp; <em>user</em>, </td>
386         </tr>
387         <tr>
388           <td></td>
389           <td></td>
390           <td class="md" nowrap>std::string&nbsp;</td>
391           <td class="mdname" nowrap>&nbsp; <em>gecos</em></td>
392         </tr>
393         <tr>
394           <td></td>
395           <td class="md">)&nbsp;</td>
396           <td class="md" colspan="2"><code> [virtual]</code></td>
397         </tr>
398
399       </table>
400     </td>
401   </tr>
402 </table>
403 <table cellspacing=5 cellpadding=0 border=0>
404   <tr>
405     <td>
406       &nbsp;
407     </td>
408     <td>
409
410 <p>
411 Change GECOS (fullname) of a user.
412 <p>
413 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.
414 <p>
415 Definition at line <a class="el" href="modules_8cpp-source.html#l00266">266</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
416 <p>
417 <div class="fragment"><pre>00267 {
418 00268         ChangeName(user,gecos.c_str());
419 00269 }
420 </pre></div>    </td>
421   </tr>
422 </table>
423 <a name="a30" doxytag="Server::ChangeHost"></a><p>
424 <table width="100%" cellpadding="2" cellspacing="0" border="0">
425   <tr>
426     <td class="md">
427       <table cellpadding="0" cellspacing="0" border="0">
428         <tr>
429           <td class="md" nowrap valign="top"> void Server::ChangeHost </td>
430           <td class="md" valign="top">(&nbsp;</td>
431           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
432           <td class="mdname" nowrap>&nbsp; <em>user</em>, </td>
433         </tr>
434         <tr>
435           <td></td>
436           <td></td>
437           <td class="md" nowrap>std::string&nbsp;</td>
438           <td class="mdname" nowrap>&nbsp; <em>host</em></td>
439         </tr>
440         <tr>
441           <td></td>
442           <td class="md">)&nbsp;</td>
443           <td class="md" colspan="2"><code> [virtual]</code></td>
444         </tr>
445
446       </table>
447     </td>
448   </tr>
449 </table>
450 <table cellspacing=5 cellpadding=0 border=0>
451   <tr>
452     <td>
453       &nbsp;
454     </td>
455     <td>
456
457 <p>
458 Change displayed hostname of a user.
459 <p>
460 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.
461 <p>
462 Definition at line <a class="el" href="modules_8cpp-source.html#l00261">261</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
463 <p>
464 <div class="fragment"><pre>00262 {
465 00263         ChangeDisplayedHost(user,host.c_str());
466 00264 }
467 </pre></div>    </td>
468   </tr>
469 </table>
470 <a name="a26" doxytag="Server::ChangeUserNick"></a><p>
471 <table width="100%" cellpadding="2" cellspacing="0" border="0">
472   <tr>
473     <td class="md">
474       <table cellpadding="0" cellspacing="0" border="0">
475         <tr>
476           <td class="md" nowrap valign="top"> void Server::ChangeUserNick </td>
477           <td class="md" valign="top">(&nbsp;</td>
478           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
479           <td class="mdname" nowrap>&nbsp; <em>user</em>, </td>
480         </tr>
481         <tr>
482           <td></td>
483           <td></td>
484           <td class="md" nowrap>std::string&nbsp;</td>
485           <td class="mdname" nowrap>&nbsp; <em>nickname</em></td>
486         </tr>
487         <tr>
488           <td></td>
489           <td class="md">)&nbsp;</td>
490           <td class="md" colspan="2"><code> [virtual]</code></td>
491         </tr>
492
493       </table>
494     </td>
495   </tr>
496 </table>
497 <table cellspacing=5 cellpadding=0 border=0>
498   <tr>
499     <td>
500       &nbsp;
501     </td>
502     <td>
503
504 <p>
505 Forces a user nickchange.
506 <p>
507 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.
508 <p>
509 Definition at line <a class="el" href="modules_8cpp-source.html#l00167">167</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
510 <p>
511 <div class="fragment"><pre>00168 {
512 00169         force_nickchange(user,nickname.c_str());
513 00170 }
514 </pre></div>    </td>
515   </tr>
516 </table>
517 <a name="a16" doxytag="Server::ChanMode"></a><p>
518 <table width="100%" cellpadding="2" cellspacing="0" border="0">
519   <tr>
520     <td class="md">
521       <table cellpadding="0" cellspacing="0" border="0">
522         <tr>
523           <td class="md" nowrap valign="top"> std::string Server::ChanMode </td>
524           <td class="md" valign="top">(&nbsp;</td>
525           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
526           <td class="mdname" nowrap>&nbsp; <em>User</em>, </td>
527         </tr>
528         <tr>
529           <td></td>
530           <td></td>
531           <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> *&nbsp;</td>
532           <td class="mdname" nowrap>&nbsp; <em>Chan</em></td>
533         </tr>
534         <tr>
535           <td></td>
536           <td class="md">)&nbsp;</td>
537           <td class="md" colspan="2"><code> [virtual]</code></td>
538         </tr>
539
540       </table>
541     </td>
542   </tr>
543 </table>
544 <table cellspacing=5 cellpadding=0 border=0>
545   <tr>
546     <td>
547       &nbsp;
548     </td>
549     <td>
550
551 <p>
552 Attempts to look up a user's privilages on a channel.
553 <p>
554 This function will return a string containing either @, , +, or an empty string, representing the user's privilages upon the channel you specify.
555 <p>
556 Definition at line <a class="el" href="modules_8cpp-source.html#l00286">286</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
557 <p>
558 <div class="fragment"><pre>00287 {
559 00288         <span class="keywordflow">return</span> cmode(User,Chan);
560 00289 }
561 </pre></div>    </td>
562   </tr>
563 </table>
564 <a name="a9" doxytag="Server::CommonChannels"></a><p>
565 <table width="100%" cellpadding="2" cellspacing="0" border="0">
566   <tr>
567     <td class="md">
568       <table cellpadding="0" cellspacing="0" border="0">
569         <tr>
570           <td class="md" nowrap valign="top"> bool Server::CommonChannels </td>
571           <td class="md" valign="top">(&nbsp;</td>
572           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
573           <td class="mdname" nowrap>&nbsp; <em>u1</em>, </td>
574         </tr>
575         <tr>
576           <td></td>
577           <td></td>
578           <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
579           <td class="mdname" nowrap>&nbsp; <em>u2</em></td>
580         </tr>
581         <tr>
582           <td></td>
583           <td class="md">)&nbsp;</td>
584           <td class="md" colspan="2"><code> [virtual]</code></td>
585         </tr>
586
587       </table>
588     </td>
589   </tr>
590 </table>
591 <table cellspacing=5 cellpadding=0 border=0>
592   <tr>
593     <td>
594       &nbsp;
595     </td>
596     <td>
597
598 <p>
599 Returns true if two users share a common channel.
600 <p>
601 This method is used internally by the NICK and QUIT commands, and the <a class="el" href="classServer.html#a10">Server::SendCommon</a> method.
602 <p>
603 Definition at line <a class="el" href="modules_8cpp-source.html#l00239">239</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
604 <p>
605 <div class="fragment"><pre>00240 {
606 00241         <span class="keywordflow">return</span> (common_channels(u1,u2) != 0);
607 00242 }
608 </pre></div>    </td>
609   </tr>
610 </table>
611 <a name="a13" doxytag="Server::CountUsers"></a><p>
612 <table width="100%" cellpadding="2" cellspacing="0" border="0">
613   <tr>
614     <td class="md">
615       <table cellpadding="0" cellspacing="0" border="0">
616         <tr>
617           <td class="md" nowrap valign="top"> int Server::CountUsers </td>
618           <td class="md" valign="top">(&nbsp;</td>
619           <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> *&nbsp;</td>
620           <td class="mdname1" valign="top" nowrap>&nbsp; <em>c</em>          </td>
621           <td class="md" valign="top">)&nbsp;</td>
622           <td class="md" nowrap><code> [virtual]</code></td>
623         </tr>
624
625       </table>
626     </td>
627   </tr>
628 </table>
629 <table cellspacing=5 cellpadding=0 border=0>
630   <tr>
631     <td>
632       &nbsp;
633     </td>
634     <td>
635
636 <p>
637 Returns a count of the number of users on a channel.
638 <p>
639 This will NEVER be 0, as if the chanrec exists, it will have at least one user in the channel.
640 <p>
641 Definition at line <a class="el" href="modules_8cpp-source.html#l00328">328</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
642 <p>
643 <div class="fragment"><pre>00329 {
644 00330         <span class="keywordflow">return</span> usercount(c);
645 00331 }
646 </pre></div>    </td>
647   </tr>
648 </table>
649 <a name="a15" doxytag="Server::FindChannel"></a><p>
650 <table width="100%" cellpadding="2" cellspacing="0" border="0">
651   <tr>
652     <td class="md">
653       <table cellpadding="0" cellspacing="0" border="0">
654         <tr>
655           <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::FindChannel </td>
656           <td class="md" valign="top">(&nbsp;</td>
657           <td class="md" nowrap valign="top">std::string&nbsp;</td>
658           <td class="mdname1" valign="top" nowrap>&nbsp; <em>channel</em>          </td>
659           <td class="md" valign="top">)&nbsp;</td>
660           <td class="md" nowrap><code> [virtual]</code></td>
661         </tr>
662
663       </table>
664     </td>
665   </tr>
666 </table>
667 <table cellspacing=5 cellpadding=0 border=0>
668   <tr>
669     <td>
670       &nbsp;
671     </td>
672     <td>
673
674 <p>
675 Attempts to look up a channel and return a pointer to it.
676 <p>
677 This function will return NULL if the channel does not exist.
678 <p>
679 Definition at line <a class="el" href="modules_8cpp-source.html#l00281">281</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
680 <p>
681 <div class="fragment"><pre>00282 {
682 00283         <span class="keywordflow">return</span> FindChan(channel.c_str());
683 00284 }
684 </pre></div>    </td>
685   </tr>
686 </table>
687 <a name="a14" doxytag="Server::FindNick"></a><p>
688 <table width="100%" cellpadding="2" cellspacing="0" border="0">
689   <tr>
690     <td class="md">
691       <table cellpadding="0" cellspacing="0" border="0">
692         <tr>
693           <td class="md" nowrap valign="top"> <a class="el" href="classuserrec.html">userrec</a> * Server::FindNick </td>
694           <td class="md" valign="top">(&nbsp;</td>
695           <td class="md" nowrap valign="top">std::string&nbsp;</td>
696           <td class="mdname1" valign="top" nowrap>&nbsp; <em>nick</em>          </td>
697           <td class="md" valign="top">)&nbsp;</td>
698           <td class="md" nowrap><code> [virtual]</code></td>
699         </tr>
700
701       </table>
702     </td>
703   </tr>
704 </table>
705 <table cellspacing=5 cellpadding=0 border=0>
706   <tr>
707     <td>
708       &nbsp;
709     </td>
710     <td>
711
712 <p>
713 Attempts to look up a nick and return a pointer to it.
714 <p>
715 This function will return NULL if the nick does not exist.
716 <p>
717 Definition at line <a class="el" href="modules_8cpp-source.html#l00276">276</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
718 <p>
719 <div class="fragment"><pre>00277 {
720 00278         <span class="keywordflow">return</span> Find(nick);
721 00279 }
722 </pre></div>    </td>
723   </tr>
724 </table>
725 <a name="a19" doxytag="Server::GetAdmin"></a><p>
726 <table width="100%" cellpadding="2" cellspacing="0" border="0">
727   <tr>
728     <td class="md">
729       <table cellpadding="0" cellspacing="0" border="0">
730         <tr>
731           <td class="md" nowrap valign="top"> <a class="el" href="classAdmin.html">Admin</a> Server::GetAdmin </td>
732           <td class="md" valign="top">(&nbsp;</td>
733           <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
734           <td class="md" valign="top">)&nbsp;</td>
735           <td class="md" nowrap><code> [virtual]</code></td>
736         </tr>
737
738       </table>
739     </td>
740   </tr>
741 </table>
742 <table cellspacing=5 cellpadding=0 border=0>
743   <tr>
744     <td>
745       &nbsp;
746     </td>
747     <td>
748
749 <p>
750 Returns the information of the server as returned by the /ADMIN command.
751 <p>
752 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#m2">Admin::Nick</a>, <a class="el" href="classAdmin.html#m1">Admin::Email</a> and <a class="el" href="classAdmin.html#m0">Admin::Name</a> contain the information for the server where the module is loaded.
753 <p>
754 Definition at line <a class="el" href="modules_8cpp-source.html#l00301">301</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
755 <p>
756 <div class="fragment"><pre>00302 {
757 00303         <span class="keywordflow">return</span> <a class="code" href="classAdmin.html">Admin</a>(getadminname(),getadminemail(),getadminnick());
758 00304 }
759 </pre></div>    </td>
760   </tr>
761 </table>
762 <a name="a18" doxytag="Server::GetNetworkName"></a><p>
763 <table width="100%" cellpadding="2" cellspacing="0" border="0">
764   <tr>
765     <td class="md">
766       <table cellpadding="0" cellspacing="0" border="0">
767         <tr>
768           <td class="md" nowrap valign="top"> std::string Server::GetNetworkName </td>
769           <td class="md" valign="top">(&nbsp;</td>
770           <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
771           <td class="md" valign="top">)&nbsp;</td>
772           <td class="md" nowrap><code> [virtual]</code></td>
773         </tr>
774
775       </table>
776     </td>
777   </tr>
778 </table>
779 <table cellspacing=5 cellpadding=0 border=0>
780   <tr>
781     <td>
782       &nbsp;
783     </td>
784     <td>
785
786 <p>
787 Returns the network name, global to all linked servers.
788 <p>
789
790 <p>
791 Definition at line <a class="el" href="modules_8cpp-source.html#l00296">296</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
792 <p>
793 <div class="fragment"><pre>00297 {
794 00298         <span class="keywordflow">return</span> getnetworkname();
795 00299 }
796 </pre></div>    </td>
797   </tr>
798 </table>
799 <a name="a17" doxytag="Server::GetServerName"></a><p>
800 <table width="100%" cellpadding="2" cellspacing="0" border="0">
801   <tr>
802     <td class="md">
803       <table cellpadding="0" cellspacing="0" border="0">
804         <tr>
805           <td class="md" nowrap valign="top"> std::string Server::GetServerName </td>
806           <td class="md" valign="top">(&nbsp;</td>
807           <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
808           <td class="md" valign="top">)&nbsp;</td>
809           <td class="md" nowrap><code> [virtual]</code></td>
810         </tr>
811
812       </table>
813     </td>
814   </tr>
815 </table>
816 <table cellspacing=5 cellpadding=0 border=0>
817   <tr>
818     <td>
819       &nbsp;
820     </td>
821     <td>
822
823 <p>
824 Returns the server name of the server where the module is loaded.
825 <p>
826
827 <p>
828 Definition at line <a class="el" href="modules_8cpp-source.html#l00291">291</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
829 <p>
830 <div class="fragment"><pre>00292 {
831 00293         <span class="keywordflow">return</span> getservername();
832 00294 }
833 </pre></div>    </td>
834   </tr>
835 </table>
836 <a name="a12" doxytag="Server::IsNick"></a><p>
837 <table width="100%" cellpadding="2" cellspacing="0" border="0">
838   <tr>
839     <td class="md">
840       <table cellpadding="0" cellspacing="0" border="0">
841         <tr>
842           <td class="md" nowrap valign="top"> bool Server::IsNick </td>
843           <td class="md" valign="top">(&nbsp;</td>
844           <td class="md" nowrap valign="top">std::string&nbsp;</td>
845           <td class="mdname1" valign="top" nowrap>&nbsp; <em>nick</em>          </td>
846           <td class="md" valign="top">)&nbsp;</td>
847           <td class="md" nowrap><code> [virtual]</code></td>
848         </tr>
849
850       </table>
851     </td>
852   </tr>
853 </table>
854 <table cellspacing=5 cellpadding=0 border=0>
855   <tr>
856     <td>
857       &nbsp;
858     </td>
859     <td>
860
861 <p>
862 Returns true if a nick is valid.
863 <p>
864 Nicks for unregistered connections will return false.
865 <p>
866 Definition at line <a class="el" href="modules_8cpp-source.html#l00271">271</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
867 <p>
868 <div class="fragment"><pre>00272 {
869 00273         <span class="keywordflow">return</span> (isnick(nick.c_str()) != 0);
870 00274 }
871 </pre></div>    </td>
872   </tr>
873 </table>
874 <a name="a24" doxytag="Server::JoinUserToChannel"></a><p>
875 <table width="100%" cellpadding="2" cellspacing="0" border="0">
876   <tr>
877     <td class="md">
878       <table cellpadding="0" cellspacing="0" border="0">
879         <tr>
880           <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::JoinUserToChannel </td>
881           <td class="md" valign="top">(&nbsp;</td>
882           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
883           <td class="mdname" nowrap>&nbsp; <em>user</em>, </td>
884         </tr>
885         <tr>
886           <td></td>
887           <td></td>
888           <td class="md" nowrap>std::string&nbsp;</td>
889           <td class="mdname" nowrap>&nbsp; <em>cname</em>, </td>
890         </tr>
891         <tr>
892           <td></td>
893           <td></td>
894           <td class="md" nowrap>std::string&nbsp;</td>
895           <td class="mdname" nowrap>&nbsp; <em>key</em></td>
896         </tr>
897         <tr>
898           <td></td>
899           <td class="md">)&nbsp;</td>
900           <td class="md" colspan="2"><code> [virtual]</code></td>
901         </tr>
902
903       </table>
904     </td>
905   </tr>
906 </table>
907 <table cellspacing=5 cellpadding=0 border=0>
908   <tr>
909     <td>
910       &nbsp;
911     </td>
912     <td>
913
914 <p>
915 Forces a user to join a channel.
916 <p>
917 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.
918 <p>
919 Definition at line <a class="el" href="modules_8cpp-source.html#l00157">157</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
920 <p>
921 <div class="fragment"><pre>00158 {
922 00159         <span class="keywordflow">return</span> add_channel(user,cname.c_str(),key.c_str(),<span class="keyword">true</span>);
923 00160 }
924 </pre></div>    </td>
925   </tr>
926 </table>
927 <a name="a3" doxytag="Server::Log"></a><p>
928 <table width="100%" cellpadding="2" cellspacing="0" border="0">
929   <tr>
930     <td class="md">
931       <table cellpadding="0" cellspacing="0" border="0">
932         <tr>
933           <td class="md" nowrap valign="top"> void Server::Log </td>
934           <td class="md" valign="top">(&nbsp;</td>
935           <td class="md" nowrap valign="top">int&nbsp;</td>
936           <td class="mdname" nowrap>&nbsp; <em>level</em>, </td>
937         </tr>
938         <tr>
939           <td></td>
940           <td></td>
941           <td class="md" nowrap>std::string&nbsp;</td>
942           <td class="mdname" nowrap>&nbsp; <em>s</em></td>
943         </tr>
944         <tr>
945           <td></td>
946           <td class="md">)&nbsp;</td>
947           <td class="md" colspan="2"><code> [virtual]</code></td>
948         </tr>
949
950       </table>
951     </td>
952   </tr>
953 </table>
954 <table cellspacing=5 cellpadding=0 border=0>
955   <tr>
956     <td>
957       &nbsp;
958     </td>
959     <td>
960
961 <p>
962 Writes a log string.
963 <p>
964 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.
965 <p>
966 Definition at line <a class="el" href="modules_8cpp-source.html#l00183">183</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
967 <p>
968 <div class="fragment"><pre>00184 {
969 00185         log(level,<span class="stringliteral">"%s"</span>,s.c_str());
970 00186 }
971 </pre></div>    </td>
972   </tr>
973 </table>
974 <a name="a28" doxytag="Server::MatchText"></a><p>
975 <table width="100%" cellpadding="2" cellspacing="0" border="0">
976   <tr>
977     <td class="md">
978       <table cellpadding="0" cellspacing="0" border="0">
979         <tr>
980           <td class="md" nowrap valign="top"> bool Server::MatchText </td>
981           <td class="md" valign="top">(&nbsp;</td>
982           <td class="md" nowrap valign="top">std::string&nbsp;</td>
983           <td class="mdname" nowrap>&nbsp; <em>sliteral</em>, </td>
984         </tr>
985         <tr>
986           <td></td>
987           <td></td>
988           <td class="md" nowrap>std::string&nbsp;</td>
989           <td class="mdname" nowrap>&nbsp; <em>spattern</em></td>
990         </tr>
991         <tr>
992           <td></td>
993           <td class="md">)&nbsp;</td>
994           <td class="md" colspan="2"><code> [virtual]</code></td>
995         </tr>
996
997       </table>
998     </td>
999   </tr>
1000 </table>
1001 <table cellspacing=5 cellpadding=0 border=0>
1002   <tr>
1003     <td>
1004       &nbsp;
1005     </td>
1006     <td>
1007
1008 <p>
1009 Matches text against a glob pattern.
1010 <p>
1011 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.
1012 <p>
1013 Definition at line <a class="el" href="modules_8cpp-source.html#l00144">144</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1014 <p>
1015 <div class="fragment"><pre>00145 {
1016 00146         <span class="keywordtype">char</span> literal[MAXBUF],pattern[MAXBUF];
1017 00147         strncpy(literal,sliteral.c_str(),MAXBUF);
1018 00148         strncpy(pattern,spattern.c_str(),MAXBUF);
1019 00149         <span class="keywordflow">return</span> match(literal,pattern);
1020 00150 }
1021 </pre></div>    </td>
1022   </tr>
1023 </table>
1024 <a name="a25" doxytag="Server::PartUserFromChannel"></a><p>
1025 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1026   <tr>
1027     <td class="md">
1028       <table cellpadding="0" cellspacing="0" border="0">
1029         <tr>
1030           <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::PartUserFromChannel </td>
1031           <td class="md" valign="top">(&nbsp;</td>
1032           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1033           <td class="mdname" nowrap>&nbsp; <em>user</em>, </td>
1034         </tr>
1035         <tr>
1036           <td></td>
1037           <td></td>
1038           <td class="md" nowrap>std::string&nbsp;</td>
1039           <td class="mdname" nowrap>&nbsp; <em>cname</em>, </td>
1040         </tr>
1041         <tr>
1042           <td></td>
1043           <td></td>
1044           <td class="md" nowrap>std::string&nbsp;</td>
1045           <td class="mdname" nowrap>&nbsp; <em>reason</em></td>
1046         </tr>
1047         <tr>
1048           <td></td>
1049           <td class="md">)&nbsp;</td>
1050           <td class="md" colspan="2"><code> [virtual]</code></td>
1051         </tr>
1052
1053       </table>
1054     </td>
1055   </tr>
1056 </table>
1057 <table cellspacing=5 cellpadding=0 border=0>
1058   <tr>
1059     <td>
1060       &nbsp;
1061     </td>
1062     <td>
1063
1064 <p>
1065 Forces a user to part a channel.
1066 <p>
1067 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.
1068 <p>
1069 Definition at line <a class="el" href="modules_8cpp-source.html#l00162">162</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1070 <p>
1071 <div class="fragment"><pre>00163 {
1072 00164         <span class="keywordflow">return</span> del_channel(user,cname.c_str(),reason.c_str(),<span class="keyword">false</span>);
1073 00165 }
1074 </pre></div>    </td>
1075   </tr>
1076 </table>
1077 <a name="a27" doxytag="Server::QuitUser"></a><p>
1078 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1079   <tr>
1080     <td class="md">
1081       <table cellpadding="0" cellspacing="0" border="0">
1082         <tr>
1083           <td class="md" nowrap valign="top"> void Server::QuitUser </td>
1084           <td class="md" valign="top">(&nbsp;</td>
1085           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1086           <td class="mdname" nowrap>&nbsp; <em>user</em>, </td>
1087         </tr>
1088         <tr>
1089           <td></td>
1090           <td></td>
1091           <td class="md" nowrap>std::string&nbsp;</td>
1092           <td class="mdname" nowrap>&nbsp; <em>reason</em></td>
1093         </tr>
1094         <tr>
1095           <td></td>
1096           <td class="md">)&nbsp;</td>
1097           <td class="md" colspan="2"><code> [virtual]</code></td>
1098         </tr>
1099
1100       </table>
1101     </td>
1102   </tr>
1103 </table>
1104 <table cellspacing=5 cellpadding=0 border=0>
1105   <tr>
1106     <td>
1107       &nbsp;
1108     </td>
1109     <td>
1110
1111 <p>
1112 Forces a user to quit with the specified reason.
1113 <p>
1114 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>
1115 WARNING!<p>
1116 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.
1117 <p>
1118 Definition at line <a class="el" href="modules_8cpp-source.html#l00172">172</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1119 <p>
1120 References <a class="el" href="users_8h-source.html#l00091">userrec::nick</a>.
1121 <p>
1122 <div class="fragment"><pre>00173 {
1123 00174         send_network_quit(user-&gt;<a class="code" href="classuserrec.html#m0">nick</a>,reason.c_str());
1124 00175         kill_link(user,reason.c_str());
1125 00176 }
1126 </pre></div>    </td>
1127   </tr>
1128 </table>
1129 <a name="a4" doxytag="Server::Send"></a><p>
1130 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1131   <tr>
1132     <td class="md">
1133       <table cellpadding="0" cellspacing="0" border="0">
1134         <tr>
1135           <td class="md" nowrap valign="top"> void Server::Send </td>
1136           <td class="md" valign="top">(&nbsp;</td>
1137           <td class="md" nowrap valign="top">int&nbsp;</td>
1138           <td class="mdname" nowrap>&nbsp; <em>Socket</em>, </td>
1139         </tr>
1140         <tr>
1141           <td></td>
1142           <td></td>
1143           <td class="md" nowrap>std::string&nbsp;</td>
1144           <td class="mdname" nowrap>&nbsp; <em>s</em></td>
1145         </tr>
1146         <tr>
1147           <td></td>
1148           <td class="md">)&nbsp;</td>
1149           <td class="md" colspan="2"><code> [virtual]</code></td>
1150         </tr>
1151
1152       </table>
1153     </td>
1154   </tr>
1155 </table>
1156 <table cellspacing=5 cellpadding=0 border=0>
1157   <tr>
1158     <td>
1159       &nbsp;
1160     </td>
1161     <td>
1162
1163 <p>
1164 Sends a line of text down a TCP/IP socket.
1165 <p>
1166 This method writes a line of text to an established socket, cutting it to 510 characters plus a carriage return and linefeed if required.
1167 <p>
1168 Definition at line <a class="el" href="modules_8cpp-source.html#l00198">198</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1169 <p>
1170 <div class="fragment"><pre>00199 {
1171 00200         Write(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
1172 00201 }
1173 </pre></div>    </td>
1174   </tr>
1175 </table>
1176 <a name="a8" doxytag="Server::SendChannel"></a><p>
1177 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1178   <tr>
1179     <td class="md">
1180       <table cellpadding="0" cellspacing="0" border="0">
1181         <tr>
1182           <td class="md" nowrap valign="top"> void Server::SendChannel </td>
1183           <td class="md" valign="top">(&nbsp;</td>
1184           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1185           <td class="mdname" nowrap>&nbsp; <em>User</em>, </td>
1186         </tr>
1187         <tr>
1188           <td></td>
1189           <td></td>
1190           <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> *&nbsp;</td>
1191           <td class="mdname" nowrap>&nbsp; <em>Channel</em>, </td>
1192         </tr>
1193         <tr>
1194           <td></td>
1195           <td></td>
1196           <td class="md" nowrap>std::string&nbsp;</td>
1197           <td class="mdname" nowrap>&nbsp; <em>s</em>, </td>
1198         </tr>
1199         <tr>
1200           <td></td>
1201           <td></td>
1202           <td class="md" nowrap>bool&nbsp;</td>
1203           <td class="mdname" nowrap>&nbsp; <em>IncludeSender</em></td>
1204         </tr>
1205         <tr>
1206           <td></td>
1207           <td class="md">)&nbsp;</td>
1208           <td class="md" colspan="2"><code> [virtual]</code></td>
1209         </tr>
1210
1211       </table>
1212     </td>
1213   </tr>
1214 </table>
1215 <table cellspacing=5 cellpadding=0 border=0>
1216   <tr>
1217     <td>
1218       &nbsp;
1219     </td>
1220     <td>
1221
1222 <p>
1223 Sends text from a user to a channel (mulicast).
1224 <p>
1225 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).
1226 <p>
1227 Definition at line <a class="el" href="modules_8cpp-source.html#l00227">227</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1228 <p>
1229 <div class="fragment"><pre>00228 {
1230 00229         <span class="keywordflow">if</span> (IncludeSender)
1231 00230         {
1232 00231                 WriteChannel(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
1233 00232         }
1234 00233         <span class="keywordflow">else</span>
1235 00234         {
1236 00235                 ChanExceptSender(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
1237 00236         }
1238 00237 }
1239 </pre></div>    </td>
1240   </tr>
1241 </table>
1242 <a name="a10" doxytag="Server::SendCommon"></a><p>
1243 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1244   <tr>
1245     <td class="md">
1246       <table cellpadding="0" cellspacing="0" border="0">
1247         <tr>
1248           <td class="md" nowrap valign="top"> void Server::SendCommon </td>
1249           <td class="md" valign="top">(&nbsp;</td>
1250           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1251           <td class="mdname" nowrap>&nbsp; <em>User</em>, </td>
1252         </tr>
1253         <tr>
1254           <td></td>
1255           <td></td>
1256           <td class="md" nowrap>std::string&nbsp;</td>
1257           <td class="mdname" nowrap>&nbsp; <em>text</em>, </td>
1258         </tr>
1259         <tr>
1260           <td></td>
1261           <td></td>
1262           <td class="md" nowrap>bool&nbsp;</td>
1263           <td class="mdname" nowrap>&nbsp; <em>IncludeSender</em></td>
1264         </tr>
1265         <tr>
1266           <td></td>
1267           <td class="md">)&nbsp;</td>
1268           <td class="md" colspan="2"><code> [virtual]</code></td>
1269         </tr>
1270
1271       </table>
1272     </td>
1273   </tr>
1274 </table>
1275 <table cellspacing=5 cellpadding=0 border=0>
1276   <tr>
1277     <td>
1278       &nbsp;
1279     </td>
1280     <td>
1281
1282 <p>
1283 Sends text from a user to one or more channels (mulicast).
1284 <p>
1285 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.
1286 <p>
1287 Definition at line <a class="el" href="modules_8cpp-source.html#l00244">244</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1288 <p>
1289 <div class="fragment"><pre>00245 {
1290 00246         <span class="keywordflow">if</span> (IncludeSender)
1291 00247         {
1292 00248                 WriteCommon(User,<span class="stringliteral">"%s"</span>,text.c_str());
1293 00249         }
1294 00250         <span class="keywordflow">else</span>
1295 00251         {
1296 00252                 WriteCommonExcept(User,<span class="stringliteral">"%s"</span>,text.c_str());
1297 00253         }
1298 00254 }
1299 </pre></div>    </td>
1300   </tr>
1301 </table>
1302 <a name="a6" doxytag="Server::SendFrom"></a><p>
1303 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1304   <tr>
1305     <td class="md">
1306       <table cellpadding="0" cellspacing="0" border="0">
1307         <tr>
1308           <td class="md" nowrap valign="top"> void Server::SendFrom </td>
1309           <td class="md" valign="top">(&nbsp;</td>
1310           <td class="md" nowrap valign="top">int&nbsp;</td>
1311           <td class="mdname" nowrap>&nbsp; <em>Socket</em>, </td>
1312         </tr>
1313         <tr>
1314           <td></td>
1315           <td></td>
1316           <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1317           <td class="mdname" nowrap>&nbsp; <em>User</em>, </td>
1318         </tr>
1319         <tr>
1320           <td></td>
1321           <td></td>
1322           <td class="md" nowrap>std::string&nbsp;</td>
1323           <td class="mdname" nowrap>&nbsp; <em>s</em></td>
1324         </tr>
1325         <tr>
1326           <td></td>
1327           <td class="md">)&nbsp;</td>
1328           <td class="md" colspan="2"><code> [virtual]</code></td>
1329         </tr>
1330
1331       </table>
1332     </td>
1333   </tr>
1334 </table>
1335 <table cellspacing=5 cellpadding=0 border=0>
1336   <tr>
1337     <td>
1338       &nbsp;
1339     </td>
1340     <td>
1341
1342 <p>
1343 Sends text from a user to a socket.
1344 <p>
1345 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)
1346 <p>
1347 Definition at line <a class="el" href="modules_8cpp-source.html#l00208">208</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1348 <p>
1349 <div class="fragment"><pre>00209 {
1350 00210         WriteFrom(Socket,User,<span class="stringliteral">"%s"</span>,s.c_str());
1351 00211 }
1352 </pre></div>    </td>
1353   </tr>
1354 </table>
1355 <a name="a22" doxytag="Server::SendMode"></a><p>
1356 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1357   <tr>
1358     <td class="md">
1359       <table cellpadding="0" cellspacing="0" border="0">
1360         <tr>
1361           <td class="md" nowrap valign="top"> void Server::SendMode </td>
1362           <td class="md" valign="top">(&nbsp;</td>
1363           <td class="md" nowrap valign="top">char **&nbsp;</td>
1364           <td class="mdname" nowrap>&nbsp; <em>parameters</em>, </td>
1365         </tr>
1366         <tr>
1367           <td></td>
1368           <td></td>
1369           <td class="md" nowrap>int&nbsp;</td>
1370           <td class="mdname" nowrap>&nbsp; <em>pcnt</em>, </td>
1371         </tr>
1372         <tr>
1373           <td></td>
1374           <td></td>
1375           <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1376           <td class="mdname" nowrap>&nbsp; <em>user</em></td>
1377         </tr>
1378         <tr>
1379           <td></td>
1380           <td class="md">)&nbsp;</td>
1381           <td class="md" colspan="2"><code> [virtual]</code></td>
1382         </tr>
1383
1384       </table>
1385     </td>
1386   </tr>
1387 </table>
1388 <table cellspacing=5 cellpadding=0 border=0>
1389   <tr>
1390     <td>
1391       &nbsp;
1392     </td>
1393     <td>
1394
1395 <p>
1396 Sends a servermode.
1397 <p>
1398 you must format the parameters array with the target, modes and parameters for those modes.<p>
1399 For example:<p>
1400 char *modes[3];<p>
1401 modes[0] = ChannelName;<p>
1402 modes[1] = "+o";<p>
1403 modes[2] = user-&gt;nick;<p>
1404 Srv-&gt;SendMode(modes,3,user);<p>
1405 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!
1406 <p>
1407 Definition at line <a class="el" href="modules_8cpp-source.html#l00193">193</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1408 <p>
1409 References <a class="el" href="modules_8h.html#a14">server_mode()</a>.
1410 <p>
1411 <div class="fragment"><pre>00194 {
1412 00195         <a class="code" href="modules_8h.html#a14">server_mode</a>(parameters,pcnt,user);
1413 00196 }
1414 </pre></div>    </td>
1415   </tr>
1416 </table>
1417 <a name="a2" doxytag="Server::SendOpers"></a><p>
1418 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1419   <tr>
1420     <td class="md">
1421       <table cellpadding="0" cellspacing="0" border="0">
1422         <tr>
1423           <td class="md" nowrap valign="top"> void Server::SendOpers </td>
1424           <td class="md" valign="top">(&nbsp;</td>
1425           <td class="md" nowrap valign="top">std::string&nbsp;</td>
1426           <td class="mdname1" valign="top" nowrap>&nbsp; <em>s</em>          </td>
1427           <td class="md" valign="top">)&nbsp;</td>
1428           <td class="md" nowrap><code> [virtual]</code></td>
1429         </tr>
1430
1431       </table>
1432     </td>
1433   </tr>
1434 </table>
1435 <table cellspacing=5 cellpadding=0 border=0>
1436   <tr>
1437     <td>
1438       &nbsp;
1439     </td>
1440     <td>
1441
1442 <p>
1443 Sends text to all opers.
1444 <p>
1445 This method sends a server notice to all opers with the usermode +s.
1446 <p>
1447 Definition at line <a class="el" href="modules_8cpp-source.html#l00139">139</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1448 <p>
1449 <div class="fragment"><pre>00140 {
1450 00141         WriteOpers(<span class="stringliteral">"%s"</span>,s.c_str());
1451 00142 }
1452 </pre></div>    </td>
1453   </tr>
1454 </table>
1455 <a name="a5" doxytag="Server::SendServ"></a><p>
1456 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1457   <tr>
1458     <td class="md">
1459       <table cellpadding="0" cellspacing="0" border="0">
1460         <tr>
1461           <td class="md" nowrap valign="top"> void Server::SendServ </td>
1462           <td class="md" valign="top">(&nbsp;</td>
1463           <td class="md" nowrap valign="top">int&nbsp;</td>
1464           <td class="mdname" nowrap>&nbsp; <em>Socket</em>, </td>
1465         </tr>
1466         <tr>
1467           <td></td>
1468           <td></td>
1469           <td class="md" nowrap>std::string&nbsp;</td>
1470           <td class="mdname" nowrap>&nbsp; <em>s</em></td>
1471         </tr>
1472         <tr>
1473           <td></td>
1474           <td class="md">)&nbsp;</td>
1475           <td class="md" colspan="2"><code> [virtual]</code></td>
1476         </tr>
1477
1478       </table>
1479     </td>
1480   </tr>
1481 </table>
1482 <table cellspacing=5 cellpadding=0 border=0>
1483   <tr>
1484     <td>
1485       &nbsp;
1486     </td>
1487     <td>
1488
1489 <p>
1490 Sends text from the server to a socket.
1491 <p>
1492 This method writes a line of text to an established socket, with the servername prepended as used by numerics (see RFC 1459)
1493 <p>
1494 Definition at line <a class="el" href="modules_8cpp-source.html#l00203">203</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1495 <p>
1496 <div class="fragment"><pre>00204 {
1497 00205         WriteServ(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
1498 00206 }
1499 </pre></div>    </td>
1500   </tr>
1501 </table>
1502 <a name="a7" doxytag="Server::SendTo"></a><p>
1503 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1504   <tr>
1505     <td class="md">
1506       <table cellpadding="0" cellspacing="0" border="0">
1507         <tr>
1508           <td class="md" nowrap valign="top"> void Server::SendTo </td>
1509           <td class="md" valign="top">(&nbsp;</td>
1510           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1511           <td class="mdname" nowrap>&nbsp; <em>Source</em>, </td>
1512         </tr>
1513         <tr>
1514           <td></td>
1515           <td></td>
1516           <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1517           <td class="mdname" nowrap>&nbsp; <em>Dest</em>, </td>
1518         </tr>
1519         <tr>
1520           <td></td>
1521           <td></td>
1522           <td class="md" nowrap>std::string&nbsp;</td>
1523           <td class="mdname" nowrap>&nbsp; <em>s</em></td>
1524         </tr>
1525         <tr>
1526           <td></td>
1527           <td class="md">)&nbsp;</td>
1528           <td class="md" colspan="2"><code> [virtual]</code></td>
1529         </tr>
1530
1531       </table>
1532     </td>
1533   </tr>
1534 </table>
1535 <table cellspacing=5 cellpadding=0 border=0>
1536   <tr>
1537     <td>
1538       &nbsp;
1539     </td>
1540     <td>
1541
1542 <p>
1543 Sends text from a user to another user.
1544 <p>
1545 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>
1546 :user!ident TEXT<p>
1547 The format will become:<p>
1548 :localserver TEXT<p>
1549 Which is useful for numerics and server notices to single users, etc.
1550 <p>
1551 Definition at line <a class="el" href="modules_8cpp-source.html#l00213">213</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1552 <p>
1553 References <a class="el" href="connection_8h-source.html#l00165">connection::fd</a>.
1554 <p>
1555 <div class="fragment"><pre>00214 {
1556 00215         <span class="keywordflow">if</span> (!Source)
1557 00216         {
1558 00217                 <span class="comment">// if source is NULL, then the message originates from the local server</span>
1559 00218                 Write(Dest-&gt;<a class="code" href="classconnection.html#m0">fd</a>,<span class="stringliteral">":%s %s"</span>,this-&gt;GetServerName().c_str(),s.c_str());
1560 00219         }
1561 00220         <span class="keywordflow">else</span>
1562 00221         {
1563 00222                 <span class="comment">// otherwise it comes from the user specified</span>
1564 00223                 WriteTo(Source,Dest,<span class="stringliteral">"%s"</span>,s.c_str());
1565 00224         }
1566 00225 }
1567 </pre></div>    </td>
1568   </tr>
1569 </table>
1570 <a name="a23" doxytag="Server::SendToModeMask"></a><p>
1571 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1572   <tr>
1573     <td class="md">
1574       <table cellpadding="0" cellspacing="0" border="0">
1575         <tr>
1576           <td class="md" nowrap valign="top"> void Server::SendToModeMask </td>
1577           <td class="md" valign="top">(&nbsp;</td>
1578           <td class="md" nowrap valign="top">std::string&nbsp;</td>
1579           <td class="mdname" nowrap>&nbsp; <em>modes</em>, </td>
1580         </tr>
1581         <tr>
1582           <td></td>
1583           <td></td>
1584           <td class="md" nowrap>int&nbsp;</td>
1585           <td class="mdname" nowrap>&nbsp; <em>flags</em>, </td>
1586         </tr>
1587         <tr>
1588           <td></td>
1589           <td></td>
1590           <td class="md" nowrap>std::string&nbsp;</td>
1591           <td class="mdname" nowrap>&nbsp; <em>text</em></td>
1592         </tr>
1593         <tr>
1594           <td></td>
1595           <td class="md">)&nbsp;</td>
1596           <td class="md" colspan="2"><code> [virtual]</code></td>
1597         </tr>
1598
1599       </table>
1600     </td>
1601   </tr>
1602 </table>
1603 <table cellspacing=5 cellpadding=0 border=0>
1604   <tr>
1605     <td>
1606       &nbsp;
1607     </td>
1608     <td>
1609
1610 <p>
1611 Sends to all users matching a mode mask You must specify one or more usermodes as the first parameter.
1612 <p>
1613 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>
1614 Serv-&gt;SendToModeMask("xi", WM_OR, "m00");<p>
1615 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.
1616 <p>
1617 Definition at line <a class="el" href="modules_8cpp-source.html#l00152">152</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1618 <p>
1619 <div class="fragment"><pre>00153 {
1620 00154         WriteMode(modes.c_str(),flags,<span class="stringliteral">"%s"</span>,text.c_str());
1621 00155 }
1622 </pre></div>    </td>
1623   </tr>
1624 </table>
1625 <a name="a11" doxytag="Server::SendWallops"></a><p>
1626 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1627   <tr>
1628     <td class="md">
1629       <table cellpadding="0" cellspacing="0" border="0">
1630         <tr>
1631           <td class="md" nowrap valign="top"> void Server::SendWallops </td>
1632           <td class="md" valign="top">(&nbsp;</td>
1633           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1634           <td class="mdname" nowrap>&nbsp; <em>User</em>, </td>
1635         </tr>
1636         <tr>
1637           <td></td>
1638           <td></td>
1639           <td class="md" nowrap>std::string&nbsp;</td>
1640           <td class="mdname" nowrap>&nbsp; <em>text</em></td>
1641         </tr>
1642         <tr>
1643           <td></td>
1644           <td class="md">)&nbsp;</td>
1645           <td class="md" colspan="2"><code> [virtual]</code></td>
1646         </tr>
1647
1648       </table>
1649     </td>
1650   </tr>
1651 </table>
1652 <table cellspacing=5 cellpadding=0 border=0>
1653   <tr>
1654     <td>
1655       &nbsp;
1656     </td>
1657     <td>
1658
1659 <p>
1660 Sends a WALLOPS message.
1661 <p>
1662 This method writes a WALLOPS message to all users with the +w flag, originating from the specified user.
1663 <p>
1664 Definition at line <a class="el" href="modules_8cpp-source.html#l00256">256</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1665 <p>
1666 <div class="fragment"><pre>00257 {
1667 00258         WriteWallOps(User,<span class="keyword">false</span>,<span class="stringliteral">"%s"</span>,text.c_str());
1668 00259 }
1669 </pre></div>    </td>
1670   </tr>
1671 </table>
1672 <hr>The documentation for this class was generated from the following files:<ul>
1673 <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>
1674 <hr><address style="align: right;"><small>Generated on Sat Apr 17 13:31:54 2004 for InspIRCd by
1675 <a href="http://www.doxygen.org/index.html">
1676 <img src="doxygen.png" alt="doxygen" align="middle" border=0 
1677 width=110 height=53></a>1.3-rc3 </small></address>
1678 </body>
1679 </html>