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