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