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