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