]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/module-doc/classServer.html
Added Module::OnAccessCheck
[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 bool&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a17">IsOnChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *User, <a class="el" href="classchanrec.html">chanrec</a> *Chan)</td></tr>
60 <tr><td>&nbsp;</td><td><font size=-1><em>Checks if a user is on a channel.</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">GetServerName</a> ()</td></tr>
62 <tr><td>&nbsp;</td><td><font size=-1><em>Returns the server name of the server where the module is loaded.</em> <a href="#a18"></a><em></em></font><br><br></td></tr>
63 <tr><td nowrap align=right valign=top>virtual std::string&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a19">GetNetworkName</a> ()</td></tr>
64 <tr><td>&nbsp;</td><td><font size=-1><em>Returns the network name, global to all linked servers.</em> <a href="#a19"></a><em></em></font><br><br></td></tr>
65 <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#a20">GetAdmin</a> ()</td></tr>
66 <tr><td>&nbsp;</td><td><font size=-1><em>Returns the information of the server as returned by the /ADMIN command.</em> <a href="#a20"></a><em></em></font><br><br></td></tr>
67 <tr><td nowrap align=right valign=top>virtual bool&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a21">AddExtendedMode</a> (char modechar, int type, bool requires_oper, int params_when_on, int params_when_off)</td></tr>
68 <tr><td>&nbsp;</td><td><font size=-1><em>Adds an extended mode letter which is parsed by a module.</em> <a href="#a21"></a><em></em></font><br><br></td></tr>
69 <tr><td nowrap align=right valign=top>virtual bool&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a22">AddExtendedListMode</a> (char modechar)</td></tr>
70 <tr><td>&nbsp;</td><td><font size=-1><em>Adds an extended mode letter which is parsed by a module and handled in a list fashion.</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">AddCommand</a> (char *cmd, handlerfunc f, char flags, int minparams)</td></tr>
72 <tr><td>&nbsp;</td><td><font size=-1><em>Adds a command to the command table.</em> <a href="#a23"></a><em></em></font><br><br></td></tr>
73 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a24">SendMode</a> (char **parameters, int pcnt, <a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
74 <tr><td>&nbsp;</td><td><font size=-1><em>Sends a servermode.</em> <a href="#a24"></a><em></em></font><br><br></td></tr>
75 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a25">SendToModeMask</a> (std::string modes, int flags, std::string text)</td></tr>
76 <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="#a25"></a><em></em></font><br><br></td></tr>
77 <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#a26">JoinUserToChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string cname, std::string key)</td></tr>
78 <tr><td>&nbsp;</td><td><font size=-1><em>Forces a user to join a channel.</em> <a href="#a26"></a><em></em></font><br><br></td></tr>
79 <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#a27">PartUserFromChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string cname, std::string reason)</td></tr>
80 <tr><td>&nbsp;</td><td><font size=-1><em>Forces a user to part a channel.</em> <a href="#a27"></a><em></em></font><br><br></td></tr>
81 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a28">ChangeUserNick</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string nickname)</td></tr>
82 <tr><td>&nbsp;</td><td><font size=-1><em>Forces a user nickchange.</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">QuitUser</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string reason)</td></tr>
84 <tr><td>&nbsp;</td><td><font size=-1><em>Forces a user to quit with the specified reason.</em> <a href="#a29"></a><em></em></font><br><br></td></tr>
85 <tr><td nowrap align=right valign=top>virtual bool&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a30">MatchText</a> (std::string sliteral, std::string spattern)</td></tr>
86 <tr><td>&nbsp;</td><td><font size=-1><em>Matches text against a glob pattern.</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">CallCommandHandler</a> (std::string commandname, char **parameters, int pcnt, <a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
88 <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="#a31"></a><em></em></font><br><br></td></tr>
89 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a32">ChangeHost</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string host)</td></tr>
90 <tr><td>&nbsp;</td><td><font size=-1><em>Change displayed hostname of a user.</em> <a href="#a32"></a><em></em></font><br><br></td></tr>
91 <tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a33">ChangeGECOS</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string gecos)</td></tr>
92 <tr><td>&nbsp;</td><td><font size=-1><em>Change GECOS (fullname) of a user.</em> <a href="#a33"></a><em></em></font><br><br></td></tr>
93 <tr><td nowrap align=right valign=top>virtual bool&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a34">IsUlined</a> (std::string server)</td></tr>
94 <tr><td>&nbsp;</td><td><font size=-1><em>Returns true if the servername you give is ulined.</em> <a href="#a34"></a><em></em></font><br><br></td></tr>
95 </table>
96 <hr><a name="_details"></a><h2>Detailed Description</h2>
97 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.
98 <p>
99 All modules should instantiate at least one copy of this class, and use its member functions to perform their tasks. 
100 <p>
101
102 <p>
103 Definition at line <a class="el" href="modules_8h-source.html#l00295">295</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2>
104 <a name="a0" doxytag="Server::Server"></a><p>
105 <table width="100%" cellpadding="2" cellspacing="0" border="0">
106   <tr>
107     <td class="md">
108       <table cellpadding="0" cellspacing="0" border="0">
109         <tr>
110           <td class="md" nowrap valign="top"> Server::Server </td>
111           <td class="md" valign="top">(&nbsp;</td>
112           <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
113           <td class="md" valign="top">)&nbsp;</td>
114           <td class="md" nowrap></td>
115         </tr>
116
117       </table>
118     </td>
119   </tr>
120 </table>
121 <table cellspacing=5 cellpadding=0 border=0>
122   <tr>
123     <td>
124       &nbsp;
125     </td>
126     <td>
127
128 <p>
129 Default constructor.
130 <p>
131 Creates a Server object.
132 <p>
133 Definition at line <a class="el" href="modules_8cpp-source.html#l00164">164</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
134 <p>
135 <div class="fragment"><pre>00165 {
136 00166 }
137 </pre></div>    </td>
138   </tr>
139 </table>
140 <a name="a1" doxytag="Server::~Server"></a><p>
141 <table width="100%" cellpadding="2" cellspacing="0" border="0">
142   <tr>
143     <td class="md">
144       <table cellpadding="0" cellspacing="0" border="0">
145         <tr>
146           <td class="md" nowrap valign="top"> Server::~Server </td>
147           <td class="md" valign="top">(&nbsp;</td>
148           <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
149           <td class="md" valign="top">)&nbsp;</td>
150           <td class="md" nowrap><code> [virtual]</code></td>
151         </tr>
152
153       </table>
154     </td>
155   </tr>
156 </table>
157 <table cellspacing=5 cellpadding=0 border=0>
158   <tr>
159     <td>
160       &nbsp;
161     </td>
162     <td>
163
164 <p>
165 Default destructor.
166 <p>
167 Destroys a Server object.
168 <p>
169 Definition at line <a class="el" href="modules_8cpp-source.html#l00168">168</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
170 <p>
171 <div class="fragment"><pre>00169 {
172 00170 }
173 </pre></div>    </td>
174   </tr>
175 </table>
176 <hr><h2>Member Function Documentation</h2>
177 <a name="a23" doxytag="Server::AddCommand"></a><p>
178 <table width="100%" cellpadding="2" cellspacing="0" border="0">
179   <tr>
180     <td class="md">
181       <table cellpadding="0" cellspacing="0" border="0">
182         <tr>
183           <td class="md" nowrap valign="top"> void Server::AddCommand </td>
184           <td class="md" valign="top">(&nbsp;</td>
185           <td class="md" nowrap valign="top">char *&nbsp;</td>
186           <td class="mdname" nowrap>&nbsp; <em>cmd</em>, </td>
187         </tr>
188         <tr>
189           <td></td>
190           <td></td>
191           <td class="md" nowrap>handlerfunc&nbsp;</td>
192           <td class="mdname" nowrap>&nbsp; <em>f</em>, </td>
193         </tr>
194         <tr>
195           <td></td>
196           <td></td>
197           <td class="md" nowrap>char&nbsp;</td>
198           <td class="mdname" nowrap>&nbsp; <em>flags</em>, </td>
199         </tr>
200         <tr>
201           <td></td>
202           <td></td>
203           <td class="md" nowrap>int&nbsp;</td>
204           <td class="mdname" nowrap>&nbsp; <em>minparams</em></td>
205         </tr>
206         <tr>
207           <td></td>
208           <td class="md">)&nbsp;</td>
209           <td class="md" colspan="2"><code> [virtual]</code></td>
210         </tr>
211
212       </table>
213     </td>
214   </tr>
215 </table>
216 <table cellspacing=5 cellpadding=0 border=0>
217   <tr>
218     <td>
219       &nbsp;
220     </td>
221     <td>
222
223 <p>
224 Adds a command to the command table.
225 <p>
226 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>
227 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>
228 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'.
229 <p>
230 Definition at line <a class="el" href="modules_8cpp-source.html#l00226">226</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
231 <p>
232 References <a class="el" href="modules_8h.html#a25">createcommand()</a>.
233 <p>
234 <div class="fragment"><pre>00227 {
235 00228         <a class="code" href="modules_8h.html#a25">createcommand</a>(cmd,f,flags,minparams);
236 00229 }
237 </pre></div>    </td>
238   </tr>
239 </table>
240 <a name="a22" doxytag="Server::AddExtendedListMode"></a><p>
241 <table width="100%" cellpadding="2" cellspacing="0" border="0">
242   <tr>
243     <td class="md">
244       <table cellpadding="0" cellspacing="0" border="0">
245         <tr>
246           <td class="md" nowrap valign="top"> bool Server::AddExtendedListMode </td>
247           <td class="md" valign="top">(&nbsp;</td>
248           <td class="md" nowrap valign="top">char&nbsp;</td>
249           <td class="mdname1" valign="top" nowrap>&nbsp; <em>modechar</em>          </td>
250           <td class="md" valign="top">)&nbsp;</td>
251           <td class="md" nowrap><code> [virtual]</code></td>
252         </tr>
253
254       </table>
255     </td>
256   </tr>
257 </table>
258 <table cellspacing=5 cellpadding=0 border=0>
259   <tr>
260     <td>
261       &nbsp;
262     </td>
263     <td>
264
265 <p>
266 Adds an extended mode letter which is parsed by a module and handled in a list fashion.
267 <p>
268 This call is used to implement modes like +q and +a. The characteristics of these modes are as follows:<p>
269 (1) They are ALWAYS on channels, not on users, therefore their type is MT_CHANNEL<p>
270 (2) They always take exactly one parameter when being added or removed<p>
271 (3) They can be set multiple times, usually on users in channels<p>
272 (4) The mode and its parameter are NOT stored in the channels modes structure<p>
273 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.
274 <p>
275 Definition at line <a class="el" href="modules_8cpp-source.html#l00371">371</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
276 <p>
277 References <a class="el" href="modules_8cpp-source.html#l00108">DoAddExtendedMode()</a>, and <a class="el" href="modules_8cpp-source.html#l00118">ModeMakeList()</a>.
278 <p>
279 <div class="fragment"><pre>00372 {
280 00373         <span class="keywordtype">bool</span> res = <a class="code" href="modules_8cpp.html#a9">DoAddExtendedMode</a>(modechar,MT_CHANNEL,<span class="keyword">false</span>,1,1);
281 00374         <span class="keywordflow">if</span> (res)
282 00375                 <a class="code" href="modules_8cpp.html#a10">ModeMakeList</a>(modechar);
283 00376         <span class="keywordflow">return</span> res;
284 00377 }
285 </pre></div>    </td>
286   </tr>
287 </table>
288 <a name="a21" doxytag="Server::AddExtendedMode"></a><p>
289 <table width="100%" cellpadding="2" cellspacing="0" border="0">
290   <tr>
291     <td class="md">
292       <table cellpadding="0" cellspacing="0" border="0">
293         <tr>
294           <td class="md" nowrap valign="top"> bool Server::AddExtendedMode </td>
295           <td class="md" valign="top">(&nbsp;</td>
296           <td class="md" nowrap valign="top">char&nbsp;</td>
297           <td class="mdname" nowrap>&nbsp; <em>modechar</em>, </td>
298         </tr>
299         <tr>
300           <td></td>
301           <td></td>
302           <td class="md" nowrap>int&nbsp;</td>
303           <td class="mdname" nowrap>&nbsp; <em>type</em>, </td>
304         </tr>
305         <tr>
306           <td></td>
307           <td></td>
308           <td class="md" nowrap>bool&nbsp;</td>
309           <td class="mdname" nowrap>&nbsp; <em>requires_oper</em>, </td>
310         </tr>
311         <tr>
312           <td></td>
313           <td></td>
314           <td class="md" nowrap>int&nbsp;</td>
315           <td class="mdname" nowrap>&nbsp; <em>params_when_on</em>, </td>
316         </tr>
317         <tr>
318           <td></td>
319           <td></td>
320           <td class="md" nowrap>int&nbsp;</td>
321           <td class="mdname" nowrap>&nbsp; <em>params_when_off</em></td>
322         </tr>
323         <tr>
324           <td></td>
325           <td class="md">)&nbsp;</td>
326           <td class="md" colspan="2"><code> [virtual]</code></td>
327         </tr>
328
329       </table>
330     </td>
331   </tr>
332 </table>
333 <table cellspacing=5 cellpadding=0 border=0>
334   <tr>
335     <td>
336       &nbsp;
337     </td>
338     <td>
339
340 <p>
341 Adds an extended mode letter which is parsed by a module.
342 <p>
343 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.
344 <p>
345 Definition at line <a class="el" href="modules_8cpp-source.html#l00351">351</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
346 <p>
347 References <a class="el" href="modules_8cpp-source.html#l00108">DoAddExtendedMode()</a>, <a class="el" href="modules_8h-source.html#l00022">MT_CLIENT</a>, and <a class="el" href="modules_8h-source.html#l00023">MT_SERVER</a>.
348 <p>
349 <div class="fragment"><pre>00352 {
350 00353         <span class="keywordflow">if</span> (type == <a class="code" href="modules_8h.html#a7">MT_SERVER</a>)
351 00354         {
352 00355                 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion"</span>);
353 00356                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
354 00357         }
355 00358         <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>))
356 00359         {
357 00360                 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Parameters on MT_CLIENT modes are not supported"</span>);
358 00361                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
359 00362         }
360 00363         <span class="keywordflow">if</span> ((params_when_on&gt;1) || (params_when_off&gt;1))
361 00364         {
362 00365                 log(DEBUG,<span class="stringliteral">"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported"</span>);
363 00366                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
364 00367         }
365 00368         <span class="keywordflow">return</span> <a class="code" href="modules_8cpp.html#a9">DoAddExtendedMode</a>(modechar,type,requires_oper,params_when_on,params_when_off);
366 00369 }
367 </pre></div>    </td>
368   </tr>
369 </table>
370 <a name="a31" doxytag="Server::CallCommandHandler"></a><p>
371 <table width="100%" cellpadding="2" cellspacing="0" border="0">
372   <tr>
373     <td class="md">
374       <table cellpadding="0" cellspacing="0" border="0">
375         <tr>
376           <td class="md" nowrap valign="top"> void Server::CallCommandHandler </td>
377           <td class="md" valign="top">(&nbsp;</td>
378           <td class="md" nowrap valign="top">std::string&nbsp;</td>
379           <td class="mdname" nowrap>&nbsp; <em>commandname</em>, </td>
380         </tr>
381         <tr>
382           <td></td>
383           <td></td>
384           <td class="md" nowrap>char **&nbsp;</td>
385           <td class="mdname" nowrap>&nbsp; <em>parameters</em>, </td>
386         </tr>
387         <tr>
388           <td></td>
389           <td></td>
390           <td class="md" nowrap>int&nbsp;</td>
391           <td class="mdname" nowrap>&nbsp; <em>pcnt</em>, </td>
392         </tr>
393         <tr>
394           <td></td>
395           <td></td>
396           <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
397           <td class="mdname" nowrap>&nbsp; <em>user</em></td>
398         </tr>
399         <tr>
400           <td></td>
401           <td class="md">)&nbsp;</td>
402           <td class="md" colspan="2"><code> [virtual]</code></td>
403         </tr>
404
405       </table>
406     </td>
407   </tr>
408 </table>
409 <table cellspacing=5 cellpadding=0 border=0>
410   <tr>
411     <td>
412       &nbsp;
413     </td>
414     <td>
415
416 <p>
417 Calls the handler for a command, either implemented by the core or by another module.
418 <p>
419 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>
420 ) 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#a23">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.
421 <p>
422 Definition at line <a class="el" href="modules_8cpp-source.html#l00216">216</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
423 <p>
424 <div class="fragment"><pre>00217 {
425 00218         call_handler(commandname.c_str(),parameters,pcnt,user);
426 00219 }
427 </pre></div>    </td>
428   </tr>
429 </table>
430 <a name="a33" doxytag="Server::ChangeGECOS"></a><p>
431 <table width="100%" cellpadding="2" cellspacing="0" border="0">
432   <tr>
433     <td class="md">
434       <table cellpadding="0" cellspacing="0" border="0">
435         <tr>
436           <td class="md" nowrap valign="top"> void Server::ChangeGECOS </td>
437           <td class="md" valign="top">(&nbsp;</td>
438           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
439           <td class="mdname" nowrap>&nbsp; <em>user</em>, </td>
440         </tr>
441         <tr>
442           <td></td>
443           <td></td>
444           <td class="md" nowrap>std::string&nbsp;</td>
445           <td class="mdname" nowrap>&nbsp; <em>gecos</em></td>
446         </tr>
447         <tr>
448           <td></td>
449           <td class="md">)&nbsp;</td>
450           <td class="md" colspan="2"><code> [virtual]</code></td>
451         </tr>
452
453       </table>
454     </td>
455   </tr>
456 </table>
457 <table cellspacing=5 cellpadding=0 border=0>
458   <tr>
459     <td>
460       &nbsp;
461     </td>
462     <td>
463
464 <p>
465 Change GECOS (fullname) of a user.
466 <p>
467 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.
468 <p>
469 Definition at line <a class="el" href="modules_8cpp-source.html#l00304">304</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
470 <p>
471 References <a class="el" href="message_8h.html#a10">ChangeName()</a>.
472 <p>
473 <div class="fragment"><pre>00305 {
474 00306         <a class="code" href="message_8h.html#a10">ChangeName</a>(user,gecos.c_str());
475 00307 }
476 </pre></div>    </td>
477   </tr>
478 </table>
479 <a name="a32" doxytag="Server::ChangeHost"></a><p>
480 <table width="100%" cellpadding="2" cellspacing="0" border="0">
481   <tr>
482     <td class="md">
483       <table cellpadding="0" cellspacing="0" border="0">
484         <tr>
485           <td class="md" nowrap valign="top"> void Server::ChangeHost </td>
486           <td class="md" valign="top">(&nbsp;</td>
487           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
488           <td class="mdname" nowrap>&nbsp; <em>user</em>, </td>
489         </tr>
490         <tr>
491           <td></td>
492           <td></td>
493           <td class="md" nowrap>std::string&nbsp;</td>
494           <td class="mdname" nowrap>&nbsp; <em>host</em></td>
495         </tr>
496         <tr>
497           <td></td>
498           <td class="md">)&nbsp;</td>
499           <td class="md" colspan="2"><code> [virtual]</code></td>
500         </tr>
501
502       </table>
503     </td>
504   </tr>
505 </table>
506 <table cellspacing=5 cellpadding=0 border=0>
507   <tr>
508     <td>
509       &nbsp;
510     </td>
511     <td>
512
513 <p>
514 Change displayed hostname of a user.
515 <p>
516 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.
517 <p>
518 Definition at line <a class="el" href="modules_8cpp-source.html#l00299">299</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
519 <p>
520 References <a class="el" href="message_8h.html#a11">ChangeDisplayedHost()</a>.
521 <p>
522 <div class="fragment"><pre>00300 {
523 00301         <a class="code" href="message_8h.html#a11">ChangeDisplayedHost</a>(user,host.c_str());
524 00302 }
525 </pre></div>    </td>
526   </tr>
527 </table>
528 <a name="a28" doxytag="Server::ChangeUserNick"></a><p>
529 <table width="100%" cellpadding="2" cellspacing="0" border="0">
530   <tr>
531     <td class="md">
532       <table cellpadding="0" cellspacing="0" border="0">
533         <tr>
534           <td class="md" nowrap valign="top"> void Server::ChangeUserNick </td>
535           <td class="md" valign="top">(&nbsp;</td>
536           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
537           <td class="mdname" nowrap>&nbsp; <em>user</em>, </td>
538         </tr>
539         <tr>
540           <td></td>
541           <td></td>
542           <td class="md" nowrap>std::string&nbsp;</td>
543           <td class="mdname" nowrap>&nbsp; <em>nickname</em></td>
544         </tr>
545         <tr>
546           <td></td>
547           <td class="md">)&nbsp;</td>
548           <td class="md" colspan="2"><code> [virtual]</code></td>
549         </tr>
550
551       </table>
552     </td>
553   </tr>
554 </table>
555 <table cellspacing=5 cellpadding=0 border=0>
556   <tr>
557     <td>
558       &nbsp;
559     </td>
560     <td>
561
562 <p>
563 Forces a user nickchange.
564 <p>
565 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.
566 <p>
567 Definition at line <a class="el" href="modules_8cpp-source.html#l00200">200</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
568 <p>
569 <div class="fragment"><pre>00201 {
570 00202         force_nickchange(user,nickname.c_str());
571 00203 }
572 </pre></div>    </td>
573   </tr>
574 </table>
575 <a name="a16" doxytag="Server::ChanMode"></a><p>
576 <table width="100%" cellpadding="2" cellspacing="0" border="0">
577   <tr>
578     <td class="md">
579       <table cellpadding="0" cellspacing="0" border="0">
580         <tr>
581           <td class="md" nowrap valign="top"> std::string Server::ChanMode </td>
582           <td class="md" valign="top">(&nbsp;</td>
583           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
584           <td class="mdname" nowrap>&nbsp; <em>User</em>, </td>
585         </tr>
586         <tr>
587           <td></td>
588           <td></td>
589           <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> *&nbsp;</td>
590           <td class="mdname" nowrap>&nbsp; <em>Chan</em></td>
591         </tr>
592         <tr>
593           <td></td>
594           <td class="md">)&nbsp;</td>
595           <td class="md" colspan="2"><code> [virtual]</code></td>
596         </tr>
597
598       </table>
599     </td>
600   </tr>
601 </table>
602 <table cellspacing=5 cellpadding=0 border=0>
603   <tr>
604     <td>
605       &nbsp;
606     </td>
607     <td>
608
609 <p>
610 Attempts to look up a user's privilages on a channel.
611 <p>
612 This function will return a string containing either @, , +, or an empty string, representing the user's privilages upon the channel you specify.
613 <p>
614 Definition at line <a class="el" href="modules_8cpp-source.html#l00324">324</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
615 <p>
616 References <a class="el" href="message_8h.html#a14">cmode()</a>.
617 <p>
618 <div class="fragment"><pre>00325 {
619 00326         <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a14">cmode</a>(User,Chan);
620 00327 }
621 </pre></div>    </td>
622   </tr>
623 </table>
624 <a name="a9" doxytag="Server::CommonChannels"></a><p>
625 <table width="100%" cellpadding="2" cellspacing="0" border="0">
626   <tr>
627     <td class="md">
628       <table cellpadding="0" cellspacing="0" border="0">
629         <tr>
630           <td class="md" nowrap valign="top"> bool Server::CommonChannels </td>
631           <td class="md" valign="top">(&nbsp;</td>
632           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
633           <td class="mdname" nowrap>&nbsp; <em>u1</em>, </td>
634         </tr>
635         <tr>
636           <td></td>
637           <td></td>
638           <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
639           <td class="mdname" nowrap>&nbsp; <em>u2</em></td>
640         </tr>
641         <tr>
642           <td></td>
643           <td class="md">)&nbsp;</td>
644           <td class="md" colspan="2"><code> [virtual]</code></td>
645         </tr>
646
647       </table>
648     </td>
649   </tr>
650 </table>
651 <table cellspacing=5 cellpadding=0 border=0>
652   <tr>
653     <td>
654       &nbsp;
655     </td>
656     <td>
657
658 <p>
659 Returns true if two users share a common channel.
660 <p>
661 This method is used internally by the NICK and QUIT commands, and the <a class="el" href="classServer.html#a10">Server::SendCommon</a> method.
662 <p>
663 Definition at line <a class="el" href="modules_8cpp-source.html#l00277">277</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
664 <p>
665 References <a class="el" href="message_8h.html#a0">common_channels()</a>.
666 <p>
667 <div class="fragment"><pre>00278 {
668 00279         <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a0">common_channels</a>(u1,u2) != 0);
669 00280 }
670 </pre></div>    </td>
671   </tr>
672 </table>
673 <a name="a13" doxytag="Server::CountUsers"></a><p>
674 <table width="100%" cellpadding="2" cellspacing="0" border="0">
675   <tr>
676     <td class="md">
677       <table cellpadding="0" cellspacing="0" border="0">
678         <tr>
679           <td class="md" nowrap valign="top"> int Server::CountUsers </td>
680           <td class="md" valign="top">(&nbsp;</td>
681           <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> *&nbsp;</td>
682           <td class="mdname1" valign="top" nowrap>&nbsp; <em>c</em>          </td>
683           <td class="md" valign="top">)&nbsp;</td>
684           <td class="md" nowrap><code> [virtual]</code></td>
685         </tr>
686
687       </table>
688     </td>
689   </tr>
690 </table>
691 <table cellspacing=5 cellpadding=0 border=0>
692   <tr>
693     <td>
694       &nbsp;
695     </td>
696     <td>
697
698 <p>
699 Returns a count of the number of users on a channel.
700 <p>
701 This will NEVER be 0, as if the chanrec exists, it will have at least one user in the channel.
702 <p>
703 Definition at line <a class="el" href="modules_8cpp-source.html#l00379">379</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
704 <p>
705 <div class="fragment"><pre>00380 {
706 00381         <span class="keywordflow">return</span> usercount(c);
707 00382 }
708 </pre></div>    </td>
709   </tr>
710 </table>
711 <a name="a15" doxytag="Server::FindChannel"></a><p>
712 <table width="100%" cellpadding="2" cellspacing="0" border="0">
713   <tr>
714     <td class="md">
715       <table cellpadding="0" cellspacing="0" border="0">
716         <tr>
717           <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::FindChannel </td>
718           <td class="md" valign="top">(&nbsp;</td>
719           <td class="md" nowrap valign="top">std::string&nbsp;</td>
720           <td class="mdname1" valign="top" nowrap>&nbsp; <em>channel</em>          </td>
721           <td class="md" valign="top">)&nbsp;</td>
722           <td class="md" nowrap><code> [virtual]</code></td>
723         </tr>
724
725       </table>
726     </td>
727   </tr>
728 </table>
729 <table cellspacing=5 cellpadding=0 border=0>
730   <tr>
731     <td>
732       &nbsp;
733     </td>
734     <td>
735
736 <p>
737 Attempts to look up a channel and return a pointer to it.
738 <p>
739 This function will return NULL if the channel does not exist.
740 <p>
741 Definition at line <a class="el" href="modules_8cpp-source.html#l00319">319</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
742 <p>
743 <div class="fragment"><pre>00320 {
744 00321         <span class="keywordflow">return</span> FindChan(channel.c_str());
745 00322 }
746 </pre></div>    </td>
747   </tr>
748 </table>
749 <a name="a14" doxytag="Server::FindNick"></a><p>
750 <table width="100%" cellpadding="2" cellspacing="0" border="0">
751   <tr>
752     <td class="md">
753       <table cellpadding="0" cellspacing="0" border="0">
754         <tr>
755           <td class="md" nowrap valign="top"> <a class="el" href="classuserrec.html">userrec</a> * Server::FindNick </td>
756           <td class="md" valign="top">(&nbsp;</td>
757           <td class="md" nowrap valign="top">std::string&nbsp;</td>
758           <td class="mdname1" valign="top" nowrap>&nbsp; <em>nick</em>          </td>
759           <td class="md" valign="top">)&nbsp;</td>
760           <td class="md" nowrap><code> [virtual]</code></td>
761         </tr>
762
763       </table>
764     </td>
765   </tr>
766 </table>
767 <table cellspacing=5 cellpadding=0 border=0>
768   <tr>
769     <td>
770       &nbsp;
771     </td>
772     <td>
773
774 <p>
775 Attempts to look up a nick and return a pointer to it.
776 <p>
777 This function will return NULL if the nick does not exist.
778 <p>
779 Definition at line <a class="el" href="modules_8cpp-source.html#l00314">314</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
780 <p>
781 <div class="fragment"><pre>00315 {
782 00316         <span class="keywordflow">return</span> Find(nick);
783 00317 }
784 </pre></div>    </td>
785   </tr>
786 </table>
787 <a name="a20" doxytag="Server::GetAdmin"></a><p>
788 <table width="100%" cellpadding="2" cellspacing="0" border="0">
789   <tr>
790     <td class="md">
791       <table cellpadding="0" cellspacing="0" border="0">
792         <tr>
793           <td class="md" nowrap valign="top"> <a class="el" href="classAdmin.html">Admin</a> Server::GetAdmin </td>
794           <td class="md" valign="top">(&nbsp;</td>
795           <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
796           <td class="md" valign="top">)&nbsp;</td>
797           <td class="md" nowrap><code> [virtual]</code></td>
798         </tr>
799
800       </table>
801     </td>
802   </tr>
803 </table>
804 <table cellspacing=5 cellpadding=0 border=0>
805   <tr>
806     <td>
807       &nbsp;
808     </td>
809     <td>
810
811 <p>
812 Returns the information of the server as returned by the /ADMIN command.
813 <p>
814 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.
815 <p>
816 Definition at line <a class="el" href="modules_8cpp-source.html#l00344">344</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
817 <p>
818 <div class="fragment"><pre>00345 {
819 00346         <span class="keywordflow">return</span> <a class="code" href="classAdmin.html">Admin</a>(getadminname(),getadminemail(),getadminnick());
820 00347 }
821 </pre></div>    </td>
822   </tr>
823 </table>
824 <a name="a19" doxytag="Server::GetNetworkName"></a><p>
825 <table width="100%" cellpadding="2" cellspacing="0" border="0">
826   <tr>
827     <td class="md">
828       <table cellpadding="0" cellspacing="0" border="0">
829         <tr>
830           <td class="md" nowrap valign="top"> std::string Server::GetNetworkName </td>
831           <td class="md" valign="top">(&nbsp;</td>
832           <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
833           <td class="md" valign="top">)&nbsp;</td>
834           <td class="md" nowrap><code> [virtual]</code></td>
835         </tr>
836
837       </table>
838     </td>
839   </tr>
840 </table>
841 <table cellspacing=5 cellpadding=0 border=0>
842   <tr>
843     <td>
844       &nbsp;
845     </td>
846     <td>
847
848 <p>
849 Returns the network name, global to all linked servers.
850 <p>
851
852 <p>
853 Definition at line <a class="el" href="modules_8cpp-source.html#l00339">339</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
854 <p>
855 <div class="fragment"><pre>00340 {
856 00341         <span class="keywordflow">return</span> getnetworkname();
857 00342 }
858 </pre></div>    </td>
859   </tr>
860 </table>
861 <a name="a18" doxytag="Server::GetServerName"></a><p>
862 <table width="100%" cellpadding="2" cellspacing="0" border="0">
863   <tr>
864     <td class="md">
865       <table cellpadding="0" cellspacing="0" border="0">
866         <tr>
867           <td class="md" nowrap valign="top"> std::string Server::GetServerName </td>
868           <td class="md" valign="top">(&nbsp;</td>
869           <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
870           <td class="md" valign="top">)&nbsp;</td>
871           <td class="md" nowrap><code> [virtual]</code></td>
872         </tr>
873
874       </table>
875     </td>
876   </tr>
877 </table>
878 <table cellspacing=5 cellpadding=0 border=0>
879   <tr>
880     <td>
881       &nbsp;
882     </td>
883     <td>
884
885 <p>
886 Returns the server name of the server where the module is loaded.
887 <p>
888
889 <p>
890 Definition at line <a class="el" href="modules_8cpp-source.html#l00334">334</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
891 <p>
892 <div class="fragment"><pre>00335 {
893 00336         <span class="keywordflow">return</span> getservername();
894 00337 }
895 </pre></div>    </td>
896   </tr>
897 </table>
898 <a name="a12" doxytag="Server::IsNick"></a><p>
899 <table width="100%" cellpadding="2" cellspacing="0" border="0">
900   <tr>
901     <td class="md">
902       <table cellpadding="0" cellspacing="0" border="0">
903         <tr>
904           <td class="md" nowrap valign="top"> bool Server::IsNick </td>
905           <td class="md" valign="top">(&nbsp;</td>
906           <td class="md" nowrap valign="top">std::string&nbsp;</td>
907           <td class="mdname1" valign="top" nowrap>&nbsp; <em>nick</em>          </td>
908           <td class="md" valign="top">)&nbsp;</td>
909           <td class="md" nowrap><code> [virtual]</code></td>
910         </tr>
911
912       </table>
913     </td>
914   </tr>
915 </table>
916 <table cellspacing=5 cellpadding=0 border=0>
917   <tr>
918     <td>
919       &nbsp;
920     </td>
921     <td>
922
923 <p>
924 Returns true if a nick is valid.
925 <p>
926 Nicks for unregistered connections will return false.
927 <p>
928 Definition at line <a class="el" href="modules_8cpp-source.html#l00309">309</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
929 <p>
930 References <a class="el" href="message_8h.html#a13">isnick()</a>.
931 <p>
932 <div class="fragment"><pre>00310 {
933 00311         <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a13">isnick</a>(nick.c_str()) != 0);
934 00312 }
935 </pre></div>    </td>
936   </tr>
937 </table>
938 <a name="a17" doxytag="Server::IsOnChannel"></a><p>
939 <table width="100%" cellpadding="2" cellspacing="0" border="0">
940   <tr>
941     <td class="md">
942       <table cellpadding="0" cellspacing="0" border="0">
943         <tr>
944           <td class="md" nowrap valign="top"> bool Server::IsOnChannel </td>
945           <td class="md" valign="top">(&nbsp;</td>
946           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
947           <td class="mdname" nowrap>&nbsp; <em>User</em>, </td>
948         </tr>
949         <tr>
950           <td></td>
951           <td></td>
952           <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> *&nbsp;</td>
953           <td class="mdname" nowrap>&nbsp; <em>Chan</em></td>
954         </tr>
955         <tr>
956           <td></td>
957           <td class="md">)&nbsp;</td>
958           <td class="md" colspan="2"><code> [virtual]</code></td>
959         </tr>
960
961       </table>
962     </td>
963   </tr>
964 </table>
965 <table cellspacing=5 cellpadding=0 border=0>
966   <tr>
967     <td>
968       &nbsp;
969     </td>
970     <td>
971
972 <p>
973 Checks if a user is on a channel.
974 <p>
975 This function will return true or false to indicate if user 'User' is on channel 'Chan'.
976 <p>
977 Definition at line <a class="el" href="modules_8cpp-source.html#l00329">329</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
978 <p>
979 References <a class="el" href="message_8h.html#a16">has_channel()</a>.
980 <p>
981 <div class="fragment"><pre>00330 {
982 00331         <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a16">has_channel</a>(User,Chan);
983 00332 }
984 </pre></div>    </td>
985   </tr>
986 </table>
987 <a name="a34" doxytag="Server::IsUlined"></a><p>
988 <table width="100%" cellpadding="2" cellspacing="0" border="0">
989   <tr>
990     <td class="md">
991       <table cellpadding="0" cellspacing="0" border="0">
992         <tr>
993           <td class="md" nowrap valign="top"> bool Server::IsUlined </td>
994           <td class="md" valign="top">(&nbsp;</td>
995           <td class="md" nowrap valign="top">std::string&nbsp;</td>
996           <td class="mdname1" valign="top" nowrap>&nbsp; <em>server</em>          </td>
997           <td class="md" valign="top">)&nbsp;</td>
998           <td class="md" nowrap><code> [virtual]</code></td>
999         </tr>
1000
1001       </table>
1002     </td>
1003   </tr>
1004 </table>
1005 <table cellspacing=5 cellpadding=0 border=0>
1006   <tr>
1007     <td>
1008       &nbsp;
1009     </td>
1010     <td>
1011
1012 <p>
1013 Returns true if the servername you give is ulined.
1014 <p>
1015 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.
1016 <p>
1017 Definition at line <a class="el" href="modules_8cpp-source.html#l00211">211</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1018 <p>
1019 References <a class="el" href="commands_8h.html#a70">is_uline()</a>.
1020 <p>
1021 <div class="fragment"><pre>00212 {
1022 00213         <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a70">is_uline</a>(server.c_str());
1023 00214 }
1024 </pre></div>    </td>
1025   </tr>
1026 </table>
1027 <a name="a26" doxytag="Server::JoinUserToChannel"></a><p>
1028 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1029   <tr>
1030     <td class="md">
1031       <table cellpadding="0" cellspacing="0" border="0">
1032         <tr>
1033           <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::JoinUserToChannel </td>
1034           <td class="md" valign="top">(&nbsp;</td>
1035           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1036           <td class="mdname" nowrap>&nbsp; <em>user</em>, </td>
1037         </tr>
1038         <tr>
1039           <td></td>
1040           <td></td>
1041           <td class="md" nowrap>std::string&nbsp;</td>
1042           <td class="mdname" nowrap>&nbsp; <em>cname</em>, </td>
1043         </tr>
1044         <tr>
1045           <td></td>
1046           <td></td>
1047           <td class="md" nowrap>std::string&nbsp;</td>
1048           <td class="mdname" nowrap>&nbsp; <em>key</em></td>
1049         </tr>
1050         <tr>
1051           <td></td>
1052           <td class="md">)&nbsp;</td>
1053           <td class="md" colspan="2"><code> [virtual]</code></td>
1054         </tr>
1055
1056       </table>
1057     </td>
1058   </tr>
1059 </table>
1060 <table cellspacing=5 cellpadding=0 border=0>
1061   <tr>
1062     <td>
1063       &nbsp;
1064     </td>
1065     <td>
1066
1067 <p>
1068 Forces a user to join a channel.
1069 <p>
1070 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.
1071 <p>
1072 Definition at line <a class="el" href="modules_8cpp-source.html#l00190">190</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1073 <p>
1074 <div class="fragment"><pre>00191 {
1075 00192         <span class="keywordflow">return</span> add_channel(user,cname.c_str(),key.c_str(),<span class="keyword">true</span>);
1076 00193 }
1077 </pre></div>    </td>
1078   </tr>
1079 </table>
1080 <a name="a3" doxytag="Server::Log"></a><p>
1081 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1082   <tr>
1083     <td class="md">
1084       <table cellpadding="0" cellspacing="0" border="0">
1085         <tr>
1086           <td class="md" nowrap valign="top"> void Server::Log </td>
1087           <td class="md" valign="top">(&nbsp;</td>
1088           <td class="md" nowrap valign="top">int&nbsp;</td>
1089           <td class="mdname" nowrap>&nbsp; <em>level</em>, </td>
1090         </tr>
1091         <tr>
1092           <td></td>
1093           <td></td>
1094           <td class="md" nowrap>std::string&nbsp;</td>
1095           <td class="mdname" nowrap>&nbsp; <em>s</em></td>
1096         </tr>
1097         <tr>
1098           <td></td>
1099           <td class="md">)&nbsp;</td>
1100           <td class="md" colspan="2"><code> [virtual]</code></td>
1101         </tr>
1102
1103       </table>
1104     </td>
1105   </tr>
1106 </table>
1107 <table cellspacing=5 cellpadding=0 border=0>
1108   <tr>
1109     <td>
1110       &nbsp;
1111     </td>
1112     <td>
1113
1114 <p>
1115 Writes a log string.
1116 <p>
1117 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.
1118 <p>
1119 Definition at line <a class="el" href="modules_8cpp-source.html#l00221">221</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1120 <p>
1121 <div class="fragment"><pre>00222 {
1122 00223         log(level,<span class="stringliteral">"%s"</span>,s.c_str());
1123 00224 }
1124 </pre></div>    </td>
1125   </tr>
1126 </table>
1127 <a name="a30" doxytag="Server::MatchText"></a><p>
1128 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1129   <tr>
1130     <td class="md">
1131       <table cellpadding="0" cellspacing="0" border="0">
1132         <tr>
1133           <td class="md" nowrap valign="top"> bool Server::MatchText </td>
1134           <td class="md" valign="top">(&nbsp;</td>
1135           <td class="md" nowrap valign="top">std::string&nbsp;</td>
1136           <td class="mdname" nowrap>&nbsp; <em>sliteral</em>, </td>
1137         </tr>
1138         <tr>
1139           <td></td>
1140           <td></td>
1141           <td class="md" nowrap>std::string&nbsp;</td>
1142           <td class="mdname" nowrap>&nbsp; <em>spattern</em></td>
1143         </tr>
1144         <tr>
1145           <td></td>
1146           <td class="md">)&nbsp;</td>
1147           <td class="md" colspan="2"><code> [virtual]</code></td>
1148         </tr>
1149
1150       </table>
1151     </td>
1152   </tr>
1153 </table>
1154 <table cellspacing=5 cellpadding=0 border=0>
1155   <tr>
1156     <td>
1157       &nbsp;
1158     </td>
1159     <td>
1160
1161 <p>
1162 Matches text against a glob pattern.
1163 <p>
1164 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.
1165 <p>
1166 Definition at line <a class="el" href="modules_8cpp-source.html#l00177">177</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1167 <p>
1168 <div class="fragment"><pre>00178 {
1169 00179         <span class="keywordtype">char</span> literal[MAXBUF],pattern[MAXBUF];
1170 00180         strncpy(literal,sliteral.c_str(),MAXBUF);
1171 00181         strncpy(pattern,spattern.c_str(),MAXBUF);
1172 00182         <span class="keywordflow">return</span> match(literal,pattern);
1173 00183 }
1174 </pre></div>    </td>
1175   </tr>
1176 </table>
1177 <a name="a27" doxytag="Server::PartUserFromChannel"></a><p>
1178 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1179   <tr>
1180     <td class="md">
1181       <table cellpadding="0" cellspacing="0" border="0">
1182         <tr>
1183           <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::PartUserFromChannel </td>
1184           <td class="md" valign="top">(&nbsp;</td>
1185           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1186           <td class="mdname" nowrap>&nbsp; <em>user</em>, </td>
1187         </tr>
1188         <tr>
1189           <td></td>
1190           <td></td>
1191           <td class="md" nowrap>std::string&nbsp;</td>
1192           <td class="mdname" nowrap>&nbsp; <em>cname</em>, </td>
1193         </tr>
1194         <tr>
1195           <td></td>
1196           <td></td>
1197           <td class="md" nowrap>std::string&nbsp;</td>
1198           <td class="mdname" nowrap>&nbsp; <em>reason</em></td>
1199         </tr>
1200         <tr>
1201           <td></td>
1202           <td class="md">)&nbsp;</td>
1203           <td class="md" colspan="2"><code> [virtual]</code></td>
1204         </tr>
1205
1206       </table>
1207     </td>
1208   </tr>
1209 </table>
1210 <table cellspacing=5 cellpadding=0 border=0>
1211   <tr>
1212     <td>
1213       &nbsp;
1214     </td>
1215     <td>
1216
1217 <p>
1218 Forces a user to part a channel.
1219 <p>
1220 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.
1221 <p>
1222 Definition at line <a class="el" href="modules_8cpp-source.html#l00195">195</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1223 <p>
1224 <div class="fragment"><pre>00196 {
1225 00197         <span class="keywordflow">return</span> del_channel(user,cname.c_str(),reason.c_str(),<span class="keyword">false</span>);
1226 00198 }
1227 </pre></div>    </td>
1228   </tr>
1229 </table>
1230 <a name="a29" doxytag="Server::QuitUser"></a><p>
1231 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1232   <tr>
1233     <td class="md">
1234       <table cellpadding="0" cellspacing="0" border="0">
1235         <tr>
1236           <td class="md" nowrap valign="top"> void Server::QuitUser </td>
1237           <td class="md" valign="top">(&nbsp;</td>
1238           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1239           <td class="mdname" nowrap>&nbsp; <em>user</em>, </td>
1240         </tr>
1241         <tr>
1242           <td></td>
1243           <td></td>
1244           <td class="md" nowrap>std::string&nbsp;</td>
1245           <td class="mdname" nowrap>&nbsp; <em>reason</em></td>
1246         </tr>
1247         <tr>
1248           <td></td>
1249           <td class="md">)&nbsp;</td>
1250           <td class="md" colspan="2"><code> [virtual]</code></td>
1251         </tr>
1252
1253       </table>
1254     </td>
1255   </tr>
1256 </table>
1257 <table cellspacing=5 cellpadding=0 border=0>
1258   <tr>
1259     <td>
1260       &nbsp;
1261     </td>
1262     <td>
1263
1264 <p>
1265 Forces a user to quit with the specified reason.
1266 <p>
1267 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>
1268 WARNING!<p>
1269 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.
1270 <p>
1271 Definition at line <a class="el" href="modules_8cpp-source.html#l00205">205</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1272 <p>
1273 References <a class="el" href="users_8h-source.html#l00091">userrec::nick</a>, and <a class="el" href="message_8h.html#a19">send_network_quit()</a>.
1274 <p>
1275 <div class="fragment"><pre>00206 {
1276 00207         <a class="code" href="message_8h.html#a19">send_network_quit</a>(user-&gt;<a class="code" href="classuserrec.html#m0">nick</a>,reason.c_str());
1277 00208         kill_link(user,reason.c_str());
1278 00209 }
1279 </pre></div>    </td>
1280   </tr>
1281 </table>
1282 <a name="a4" doxytag="Server::Send"></a><p>
1283 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1284   <tr>
1285     <td class="md">
1286       <table cellpadding="0" cellspacing="0" border="0">
1287         <tr>
1288           <td class="md" nowrap valign="top"> void Server::Send </td>
1289           <td class="md" valign="top">(&nbsp;</td>
1290           <td class="md" nowrap valign="top">int&nbsp;</td>
1291           <td class="mdname" nowrap>&nbsp; <em>Socket</em>, </td>
1292         </tr>
1293         <tr>
1294           <td></td>
1295           <td></td>
1296           <td class="md" nowrap>std::string&nbsp;</td>
1297           <td class="mdname" nowrap>&nbsp; <em>s</em></td>
1298         </tr>
1299         <tr>
1300           <td></td>
1301           <td class="md">)&nbsp;</td>
1302           <td class="md" colspan="2"><code> [virtual]</code></td>
1303         </tr>
1304
1305       </table>
1306     </td>
1307   </tr>
1308 </table>
1309 <table cellspacing=5 cellpadding=0 border=0>
1310   <tr>
1311     <td>
1312       &nbsp;
1313     </td>
1314     <td>
1315
1316 <p>
1317 Sends a line of text down a TCP/IP socket.
1318 <p>
1319 This method writes a line of text to an established socket, cutting it to 510 characters plus a carriage return and linefeed if required.
1320 <p>
1321 Definition at line <a class="el" href="modules_8cpp-source.html#l00236">236</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1322 <p>
1323 <div class="fragment"><pre>00237 {
1324 00238         Write(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
1325 00239 }
1326 </pre></div>    </td>
1327   </tr>
1328 </table>
1329 <a name="a8" doxytag="Server::SendChannel"></a><p>
1330 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1331   <tr>
1332     <td class="md">
1333       <table cellpadding="0" cellspacing="0" border="0">
1334         <tr>
1335           <td class="md" nowrap valign="top"> void Server::SendChannel </td>
1336           <td class="md" valign="top">(&nbsp;</td>
1337           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1338           <td class="mdname" nowrap>&nbsp; <em>User</em>, </td>
1339         </tr>
1340         <tr>
1341           <td></td>
1342           <td></td>
1343           <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> *&nbsp;</td>
1344           <td class="mdname" nowrap>&nbsp; <em>Channel</em>, </td>
1345         </tr>
1346         <tr>
1347           <td></td>
1348           <td></td>
1349           <td class="md" nowrap>std::string&nbsp;</td>
1350           <td class="mdname" nowrap>&nbsp; <em>s</em>, </td>
1351         </tr>
1352         <tr>
1353           <td></td>
1354           <td></td>
1355           <td class="md" nowrap>bool&nbsp;</td>
1356           <td class="mdname" nowrap>&nbsp; <em>IncludeSender</em></td>
1357         </tr>
1358         <tr>
1359           <td></td>
1360           <td class="md">)&nbsp;</td>
1361           <td class="md" colspan="2"><code> [virtual]</code></td>
1362         </tr>
1363
1364       </table>
1365     </td>
1366   </tr>
1367 </table>
1368 <table cellspacing=5 cellpadding=0 border=0>
1369   <tr>
1370     <td>
1371       &nbsp;
1372     </td>
1373     <td>
1374
1375 <p>
1376 Sends text from a user to a channel (mulicast).
1377 <p>
1378 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).
1379 <p>
1380 Definition at line <a class="el" href="modules_8cpp-source.html#l00265">265</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1381 <p>
1382 <div class="fragment"><pre>00266 {
1383 00267         <span class="keywordflow">if</span> (IncludeSender)
1384 00268         {
1385 00269                 WriteChannel(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
1386 00270         }
1387 00271         <span class="keywordflow">else</span>
1388 00272         {
1389 00273                 ChanExceptSender(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
1390 00274         }
1391 00275 }
1392 </pre></div>    </td>
1393   </tr>
1394 </table>
1395 <a name="a10" doxytag="Server::SendCommon"></a><p>
1396 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1397   <tr>
1398     <td class="md">
1399       <table cellpadding="0" cellspacing="0" border="0">
1400         <tr>
1401           <td class="md" nowrap valign="top"> void Server::SendCommon </td>
1402           <td class="md" valign="top">(&nbsp;</td>
1403           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1404           <td class="mdname" nowrap>&nbsp; <em>User</em>, </td>
1405         </tr>
1406         <tr>
1407           <td></td>
1408           <td></td>
1409           <td class="md" nowrap>std::string&nbsp;</td>
1410           <td class="mdname" nowrap>&nbsp; <em>text</em>, </td>
1411         </tr>
1412         <tr>
1413           <td></td>
1414           <td></td>
1415           <td class="md" nowrap>bool&nbsp;</td>
1416           <td class="mdname" nowrap>&nbsp; <em>IncludeSender</em></td>
1417         </tr>
1418         <tr>
1419           <td></td>
1420           <td class="md">)&nbsp;</td>
1421           <td class="md" colspan="2"><code> [virtual]</code></td>
1422         </tr>
1423
1424       </table>
1425     </td>
1426   </tr>
1427 </table>
1428 <table cellspacing=5 cellpadding=0 border=0>
1429   <tr>
1430     <td>
1431       &nbsp;
1432     </td>
1433     <td>
1434
1435 <p>
1436 Sends text from a user to one or more channels (mulicast).
1437 <p>
1438 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.
1439 <p>
1440 Definition at line <a class="el" href="modules_8cpp-source.html#l00282">282</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1441 <p>
1442 <div class="fragment"><pre>00283 {
1443 00284         <span class="keywordflow">if</span> (IncludeSender)
1444 00285         {
1445 00286                 WriteCommon(User,<span class="stringliteral">"%s"</span>,text.c_str());
1446 00287         }
1447 00288         <span class="keywordflow">else</span>
1448 00289         {
1449 00290                 WriteCommonExcept(User,<span class="stringliteral">"%s"</span>,text.c_str());
1450 00291         }
1451 00292 }
1452 </pre></div>    </td>
1453   </tr>
1454 </table>
1455 <a name="a6" doxytag="Server::SendFrom"></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::SendFrom </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><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1470           <td class="mdname" nowrap>&nbsp; <em>User</em>, </td>
1471         </tr>
1472         <tr>
1473           <td></td>
1474           <td></td>
1475           <td class="md" nowrap>std::string&nbsp;</td>
1476           <td class="mdname" nowrap>&nbsp; <em>s</em></td>
1477         </tr>
1478         <tr>
1479           <td></td>
1480           <td class="md">)&nbsp;</td>
1481           <td class="md" colspan="2"><code> [virtual]</code></td>
1482         </tr>
1483
1484       </table>
1485     </td>
1486   </tr>
1487 </table>
1488 <table cellspacing=5 cellpadding=0 border=0>
1489   <tr>
1490     <td>
1491       &nbsp;
1492     </td>
1493     <td>
1494
1495 <p>
1496 Sends text from a user to a socket.
1497 <p>
1498 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)
1499 <p>
1500 Definition at line <a class="el" href="modules_8cpp-source.html#l00246">246</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1501 <p>
1502 <div class="fragment"><pre>00247 {
1503 00248         WriteFrom(Socket,User,<span class="stringliteral">"%s"</span>,s.c_str());
1504 00249 }
1505 </pre></div>    </td>
1506   </tr>
1507 </table>
1508 <a name="a24" doxytag="Server::SendMode"></a><p>
1509 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1510   <tr>
1511     <td class="md">
1512       <table cellpadding="0" cellspacing="0" border="0">
1513         <tr>
1514           <td class="md" nowrap valign="top"> void Server::SendMode </td>
1515           <td class="md" valign="top">(&nbsp;</td>
1516           <td class="md" nowrap valign="top">char **&nbsp;</td>
1517           <td class="mdname" nowrap>&nbsp; <em>parameters</em>, </td>
1518         </tr>
1519         <tr>
1520           <td></td>
1521           <td></td>
1522           <td class="md" nowrap>int&nbsp;</td>
1523           <td class="mdname" nowrap>&nbsp; <em>pcnt</em>, </td>
1524         </tr>
1525         <tr>
1526           <td></td>
1527           <td></td>
1528           <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1529           <td class="mdname" nowrap>&nbsp; <em>user</em></td>
1530         </tr>
1531         <tr>
1532           <td></td>
1533           <td class="md">)&nbsp;</td>
1534           <td class="md" colspan="2"><code> [virtual]</code></td>
1535         </tr>
1536
1537       </table>
1538     </td>
1539   </tr>
1540 </table>
1541 <table cellspacing=5 cellpadding=0 border=0>
1542   <tr>
1543     <td>
1544       &nbsp;
1545     </td>
1546     <td>
1547
1548 <p>
1549 Sends a servermode.
1550 <p>
1551 you must format the parameters array with the target, modes and parameters for those modes.<p>
1552 For example:<p>
1553 char *modes[3];<p>
1554 modes[0] = ChannelName;<p>
1555 modes[1] = "+o";<p>
1556 modes[2] = user-&gt;nick;<p>
1557 Srv-&gt;SendMode(modes,3,user);<p>
1558 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!
1559 <p>
1560 Definition at line <a class="el" href="modules_8cpp-source.html#l00231">231</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1561 <p>
1562 References <a class="el" href="modules_8h.html#a26">server_mode()</a>.
1563 <p>
1564 <div class="fragment"><pre>00232 {
1565 00233         <a class="code" href="modules_8h.html#a26">server_mode</a>(parameters,pcnt,user);
1566 00234 }
1567 </pre></div>    </td>
1568   </tr>
1569 </table>
1570 <a name="a2" doxytag="Server::SendOpers"></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::SendOpers </td>
1577           <td class="md" valign="top">(&nbsp;</td>
1578           <td class="md" nowrap valign="top">std::string&nbsp;</td>
1579           <td class="mdname1" valign="top" nowrap>&nbsp; <em>s</em>          </td>
1580           <td class="md" valign="top">)&nbsp;</td>
1581           <td class="md" nowrap><code> [virtual]</code></td>
1582         </tr>
1583
1584       </table>
1585     </td>
1586   </tr>
1587 </table>
1588 <table cellspacing=5 cellpadding=0 border=0>
1589   <tr>
1590     <td>
1591       &nbsp;
1592     </td>
1593     <td>
1594
1595 <p>
1596 Sends text to all opers.
1597 <p>
1598 This method sends a server notice to all opers with the usermode +s.
1599 <p>
1600 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>.
1601 <p>
1602 <div class="fragment"><pre>00173 {
1603 00174         WriteOpers(<span class="stringliteral">"%s"</span>,s.c_str());
1604 00175 }
1605 </pre></div>    </td>
1606   </tr>
1607 </table>
1608 <a name="a5" doxytag="Server::SendServ"></a><p>
1609 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1610   <tr>
1611     <td class="md">
1612       <table cellpadding="0" cellspacing="0" border="0">
1613         <tr>
1614           <td class="md" nowrap valign="top"> void Server::SendServ </td>
1615           <td class="md" valign="top">(&nbsp;</td>
1616           <td class="md" nowrap valign="top">int&nbsp;</td>
1617           <td class="mdname" nowrap>&nbsp; <em>Socket</em>, </td>
1618         </tr>
1619         <tr>
1620           <td></td>
1621           <td></td>
1622           <td class="md" nowrap>std::string&nbsp;</td>
1623           <td class="mdname" nowrap>&nbsp; <em>s</em></td>
1624         </tr>
1625         <tr>
1626           <td></td>
1627           <td class="md">)&nbsp;</td>
1628           <td class="md" colspan="2"><code> [virtual]</code></td>
1629         </tr>
1630
1631       </table>
1632     </td>
1633   </tr>
1634 </table>
1635 <table cellspacing=5 cellpadding=0 border=0>
1636   <tr>
1637     <td>
1638       &nbsp;
1639     </td>
1640     <td>
1641
1642 <p>
1643 Sends text from the server to a socket.
1644 <p>
1645 This method writes a line of text to an established socket, with the servername prepended as used by numerics (see RFC 1459)
1646 <p>
1647 Definition at line <a class="el" href="modules_8cpp-source.html#l00241">241</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1648 <p>
1649 <div class="fragment"><pre>00242 {
1650 00243         WriteServ(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
1651 00244 }
1652 </pre></div>    </td>
1653   </tr>
1654 </table>
1655 <a name="a7" doxytag="Server::SendTo"></a><p>
1656 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1657   <tr>
1658     <td class="md">
1659       <table cellpadding="0" cellspacing="0" border="0">
1660         <tr>
1661           <td class="md" nowrap valign="top"> void Server::SendTo </td>
1662           <td class="md" valign="top">(&nbsp;</td>
1663           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1664           <td class="mdname" nowrap>&nbsp; <em>Source</em>, </td>
1665         </tr>
1666         <tr>
1667           <td></td>
1668           <td></td>
1669           <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1670           <td class="mdname" nowrap>&nbsp; <em>Dest</em>, </td>
1671         </tr>
1672         <tr>
1673           <td></td>
1674           <td></td>
1675           <td class="md" nowrap>std::string&nbsp;</td>
1676           <td class="mdname" nowrap>&nbsp; <em>s</em></td>
1677         </tr>
1678         <tr>
1679           <td></td>
1680           <td class="md">)&nbsp;</td>
1681           <td class="md" colspan="2"><code> [virtual]</code></td>
1682         </tr>
1683
1684       </table>
1685     </td>
1686   </tr>
1687 </table>
1688 <table cellspacing=5 cellpadding=0 border=0>
1689   <tr>
1690     <td>
1691       &nbsp;
1692     </td>
1693     <td>
1694
1695 <p>
1696 Sends text from a user to another user.
1697 <p>
1698 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>
1699 :user!ident TEXT<p>
1700 The format will become:<p>
1701 :localserver TEXT<p>
1702 Which is useful for numerics and server notices to single users, etc.
1703 <p>
1704 Definition at line <a class="el" href="modules_8cpp-source.html#l00251">251</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1705 <p>
1706 References <a class="el" href="connection_8h-source.html#l00166">connection::fd</a>.
1707 <p>
1708 <div class="fragment"><pre>00252 {
1709 00253         <span class="keywordflow">if</span> (!Source)
1710 00254         {
1711 00255                 <span class="comment">// if source is NULL, then the message originates from the local server</span>
1712 00256                 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());
1713 00257         }
1714 00258         <span class="keywordflow">else</span>
1715 00259         {
1716 00260                 <span class="comment">// otherwise it comes from the user specified</span>
1717 00261                 WriteTo(Source,Dest,<span class="stringliteral">"%s"</span>,s.c_str());
1718 00262         }
1719 00263 }
1720 </pre></div>    </td>
1721   </tr>
1722 </table>
1723 <a name="a25" doxytag="Server::SendToModeMask"></a><p>
1724 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1725   <tr>
1726     <td class="md">
1727       <table cellpadding="0" cellspacing="0" border="0">
1728         <tr>
1729           <td class="md" nowrap valign="top"> void Server::SendToModeMask </td>
1730           <td class="md" valign="top">(&nbsp;</td>
1731           <td class="md" nowrap valign="top">std::string&nbsp;</td>
1732           <td class="mdname" nowrap>&nbsp; <em>modes</em>, </td>
1733         </tr>
1734         <tr>
1735           <td></td>
1736           <td></td>
1737           <td class="md" nowrap>int&nbsp;</td>
1738           <td class="mdname" nowrap>&nbsp; <em>flags</em>, </td>
1739         </tr>
1740         <tr>
1741           <td></td>
1742           <td></td>
1743           <td class="md" nowrap>std::string&nbsp;</td>
1744           <td class="mdname" nowrap>&nbsp; <em>text</em></td>
1745         </tr>
1746         <tr>
1747           <td></td>
1748           <td class="md">)&nbsp;</td>
1749           <td class="md" colspan="2"><code> [virtual]</code></td>
1750         </tr>
1751
1752       </table>
1753     </td>
1754   </tr>
1755 </table>
1756 <table cellspacing=5 cellpadding=0 border=0>
1757   <tr>
1758     <td>
1759       &nbsp;
1760     </td>
1761     <td>
1762
1763 <p>
1764 Sends to all users matching a mode mask You must specify one or more usermodes as the first parameter.
1765 <p>
1766 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>
1767 Serv-&gt;SendToModeMask("xi", WM_OR, "m00");<p>
1768 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.
1769 <p>
1770 Definition at line <a class="el" href="modules_8cpp-source.html#l00185">185</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1771 <p>
1772 <div class="fragment"><pre>00186 {
1773 00187         WriteMode(modes.c_str(),flags,<span class="stringliteral">"%s"</span>,text.c_str());
1774 00188 }
1775 </pre></div>    </td>
1776   </tr>
1777 </table>
1778 <a name="a11" doxytag="Server::SendWallops"></a><p>
1779 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1780   <tr>
1781     <td class="md">
1782       <table cellpadding="0" cellspacing="0" border="0">
1783         <tr>
1784           <td class="md" nowrap valign="top"> void Server::SendWallops </td>
1785           <td class="md" valign="top">(&nbsp;</td>
1786           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1787           <td class="mdname" nowrap>&nbsp; <em>User</em>, </td>
1788         </tr>
1789         <tr>
1790           <td></td>
1791           <td></td>
1792           <td class="md" nowrap>std::string&nbsp;</td>
1793           <td class="mdname" nowrap>&nbsp; <em>text</em></td>
1794         </tr>
1795         <tr>
1796           <td></td>
1797           <td class="md">)&nbsp;</td>
1798           <td class="md" colspan="2"><code> [virtual]</code></td>
1799         </tr>
1800
1801       </table>
1802     </td>
1803   </tr>
1804 </table>
1805 <table cellspacing=5 cellpadding=0 border=0>
1806   <tr>
1807     <td>
1808       &nbsp;
1809     </td>
1810     <td>
1811
1812 <p>
1813 Sends a WALLOPS message.
1814 <p>
1815 This method writes a WALLOPS message to all users with the +w flag, originating from the specified user.
1816 <p>
1817 Definition at line <a class="el" href="modules_8cpp-source.html#l00294">294</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1818 <p>
1819 <div class="fragment"><pre>00295 {
1820 00296         WriteWallOps(User,<span class="keyword">false</span>,<span class="stringliteral">"%s"</span>,text.c_str());
1821 00297 }
1822 </pre></div>    </td>
1823   </tr>
1824 </table>
1825 <hr>The documentation for this class was generated from the following files:<ul>
1826 <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>
1827 <hr><address style="align: right;"><small>Generated on Sat May 1 13:39:24 2004 for InspIRCd by
1828 <a href="http://www.doxygen.org/index.html">
1829 <img src="doxygen.png" alt="doxygen" align="middle" border=0 
1830 width=110 height=53></a>1.3-rc3 </small></address>
1831 </body>
1832 </html>