1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>Server class Reference</title>
4 <link href="inspircd.css" rel="stylesheet" type="text/css">
6 <!-- Generated by Doxygen 1.3-rc3 -->
8 <a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center>
9 <hr><h1>Server Class Reference</h1>Allows server output and query functions This class contains methods which allow a module to query the state of the irc server, and produce output to users and other servers.
10 <a href="#_details">More...</a>
12 <code>#include <<a class="el" href="modules_8h-source.html">modules.h</a>></code>
14 Inheritance diagram for Server:<p><center><img src="classServer__inherit__graph.gif" border="0" usemap="#Server__inherit__map" alt="Inheritance graph"></center>
15 <map name="Server__inherit__map">
16 <area href="classclassbase.html" shape="rect" coords="7,16,73,37" alt="">
18 <center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for Server:<p><center><img src="classServer__coll__graph.gif" border="0" usemap="#Server__coll__map" alt="Collaboration graph"></center>
19 <map name="Server__coll__map">
20 <area href="classclassbase.html" shape="rect" coords="7,106,73,128" alt="">
22 <center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center><a href="classServer-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
24 <tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
25 <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classServer.html#a0">Server</a> ()</td></tr>
26 <tr><td> </td><td><font size=-1><em>Default constructor.</em> <a href="#a0"></a><em></em></font><br><br></td></tr>
27 <tr><td nowrap align=right valign=top>virtual </td><td valign=bottom><a class="el" href="classServer.html#a1">~Server</a> ()</td></tr>
28 <tr><td> </td><td><font size=-1><em>Default destructor.</em> <a href="#a1"></a><em></em></font><br><br></td></tr>
29 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a2">SendOpers</a> (std::string s)</td></tr>
30 <tr><td> </td><td><font size=-1><em>Sends text to all opers.</em> <a href="#a2"></a><em></em></font><br><br></td></tr>
31 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a3">Log</a> (int level, std::string s)</td></tr>
32 <tr><td> </td><td><font size=-1><em>Writes a log string.</em> <a href="#a3"></a><em></em></font><br><br></td></tr>
33 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a4">Send</a> (int Socket, std::string s)</td></tr>
34 <tr><td> </td><td><font size=-1><em>Sends a line of text down a TCP/IP socket.</em> <a href="#a4"></a><em></em></font><br><br></td></tr>
35 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a5">SendServ</a> (int Socket, std::string s)</td></tr>
36 <tr><td> </td><td><font size=-1><em>Sends text from the server to a socket.</em> <a href="#a5"></a><em></em></font><br><br></td></tr>
37 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a6">SendFrom</a> (int Socket, <a class="el" href="classuserrec.html">userrec</a> *User, std::string s)</td></tr>
38 <tr><td> </td><td><font size=-1><em>Sends text from a user to a socket.</em> <a href="#a6"></a><em></em></font><br><br></td></tr>
39 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a7">SendTo</a> (<a class="el" href="classuserrec.html">userrec</a> *Source, <a class="el" href="classuserrec.html">userrec</a> *Dest, std::string s)</td></tr>
40 <tr><td> </td><td><font size=-1><em>Sends text from a user to another user.</em> <a href="#a7"></a><em></em></font><br><br></td></tr>
41 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a8">SendChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *User, <a class="el" href="classchanrec.html">chanrec</a> *Channel, std::string s, bool IncludeSender)</td></tr>
42 <tr><td> </td><td><font size=-1><em>Sends text from a user to a channel (mulicast).</em> <a href="#a8"></a><em></em></font><br><br></td></tr>
43 <tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="classServer.html#a9">CommonChannels</a> (<a class="el" href="classuserrec.html">userrec</a> *u1, <a class="el" href="classuserrec.html">userrec</a> *u2)</td></tr>
44 <tr><td> </td><td><font size=-1><em>Returns true if two users share a common channel.</em> <a href="#a9"></a><em></em></font><br><br></td></tr>
45 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a10">SendCommon</a> (<a class="el" href="classuserrec.html">userrec</a> *User, std::string text, bool IncludeSender)</td></tr>
46 <tr><td> </td><td><font size=-1><em>Sends text from a user to one or more channels (mulicast).</em> <a href="#a10"></a><em></em></font><br><br></td></tr>
47 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a11">SendWallops</a> (<a class="el" href="classuserrec.html">userrec</a> *User, std::string text)</td></tr>
48 <tr><td> </td><td><font size=-1><em>Sends a WALLOPS message.</em> <a href="#a11"></a><em></em></font><br><br></td></tr>
49 <tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="classServer.html#a12">IsNick</a> (std::string nick)</td></tr>
50 <tr><td> </td><td><font size=-1><em>Returns true if a nick is valid.</em> <a href="#a12"></a><em></em></font><br><br></td></tr>
51 <tr><td nowrap align=right valign=top>virtual int </td><td valign=bottom><a class="el" href="classServer.html#a13">CountUsers</a> (<a class="el" href="classchanrec.html">chanrec</a> *c)</td></tr>
52 <tr><td> </td><td><font size=-1><em>Returns a count of the number of users on a channel.</em> <a href="#a13"></a><em></em></font><br><br></td></tr>
53 <tr><td nowrap align=right valign=top>virtual <a class="el" href="classuserrec.html">userrec</a> * </td><td valign=bottom><a class="el" href="classServer.html#a14">FindNick</a> (std::string nick)</td></tr>
54 <tr><td> </td><td><font size=-1><em>Attempts to look up a nick and return a pointer to it.</em> <a href="#a14"></a><em></em></font><br><br></td></tr>
55 <tr><td nowrap align=right valign=top>virtual <a class="el" href="classchanrec.html">chanrec</a> * </td><td valign=bottom><a class="el" href="classServer.html#a15">FindChannel</a> (std::string channel)</td></tr>
56 <tr><td> </td><td><font size=-1><em>Attempts to look up a channel and return a pointer to it.</em> <a href="#a15"></a><em></em></font><br><br></td></tr>
57 <tr><td nowrap align=right valign=top>virtual std::string </td><td valign=bottom><a class="el" href="classServer.html#a16">ChanMode</a> (<a class="el" href="classuserrec.html">userrec</a> *User, <a class="el" href="classchanrec.html">chanrec</a> *Chan)</td></tr>
58 <tr><td> </td><td><font size=-1><em>Attempts to look up a user's privilages on a channel.</em> <a href="#a16"></a><em></em></font><br><br></td></tr>
59 <tr><td nowrap align=right valign=top>virtual std::string </td><td valign=bottom><a class="el" href="classServer.html#a17">GetServerName</a> ()</td></tr>
60 <tr><td> </td><td><font size=-1><em>Returns the server name of the server where the module is loaded.</em> <a href="#a17"></a><em></em></font><br><br></td></tr>
61 <tr><td nowrap align=right valign=top>virtual std::string </td><td valign=bottom><a class="el" href="classServer.html#a18">GetNetworkName</a> ()</td></tr>
62 <tr><td> </td><td><font size=-1><em>Returns the network name, global to all linked servers.</em> <a href="#a18"></a><em></em></font><br><br></td></tr>
63 <tr><td nowrap align=right valign=top>virtual <a class="el" href="classAdmin.html">Admin</a> </td><td valign=bottom><a class="el" href="classServer.html#a19">GetAdmin</a> ()</td></tr>
64 <tr><td> </td><td><font size=-1><em>Returns the information of the server as returned by the /ADMIN command.</em> <a href="#a19"></a><em></em></font><br><br></td></tr>
65 <tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="classServer.html#a20">AddExtendedMode</a> (char modechar, int type, bool requires_oper, int params_when_on, int params_when_off)</td></tr>
66 <tr><td> </td><td><font size=-1><em>Adds an extended mode letter which is parsed by a module This allows modules to add extra mode letters, e.g.</em> <a href="#a20"></a><em></em></font><br><br></td></tr>
67 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a21">AddCommand</a> (char *cmd, handlerfunc f, char flags, int minparams)</td></tr>
68 <tr><td> </td><td><font size=-1><em>Adds a command to the command table.</em> <a href="#a21"></a><em></em></font><br><br></td></tr>
69 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a22">SendMode</a> (char **parameters, int pcnt, <a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
70 <tr><td> </td><td><font size=-1><em>Sends a servermode.</em> <a href="#a22"></a><em></em></font><br><br></td></tr>
71 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a23">SendToModeMask</a> (std::string modes, int flags, std::string text)</td></tr>
72 <tr><td> </td><td><font size=-1><em>Sends to all users matching a mode mask You must specify one or more usermodes as the first parameter.</em> <a href="#a23"></a><em></em></font><br><br></td></tr>
73 <tr><td nowrap align=right valign=top>virtual <a class="el" href="classchanrec.html">chanrec</a> * </td><td valign=bottom><a class="el" href="classServer.html#a24">JoinUserToChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string cname, std::string key)</td></tr>
74 <tr><td> </td><td><font size=-1><em>Forces a user to join a channel.</em> <a href="#a24"></a><em></em></font><br><br></td></tr>
75 <tr><td nowrap align=right valign=top>virtual <a class="el" href="classchanrec.html">chanrec</a> * </td><td valign=bottom><a class="el" href="classServer.html#a25">PartUserFromChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string cname, std::string reason)</td></tr>
76 <tr><td> </td><td><font size=-1><em>Forces a user to part a channel.</em> <a href="#a25"></a><em></em></font><br><br></td></tr>
77 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a26">ChangeUserNick</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string nickname)</td></tr>
78 <tr><td> </td><td><font size=-1><em>Forces a user nickchange.</em> <a href="#a26"></a><em></em></font><br><br></td></tr>
79 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a27">QuitUser</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string reason)</td></tr>
80 <tr><td> </td><td><font size=-1><em>Forces a user to quit with the specified reason.</em> <a href="#a27"></a><em></em></font><br><br></td></tr>
81 <tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="classServer.html#a28">MatchText</a> (std::string sliteral, std::string spattern)</td></tr>
82 <tr><td> </td><td><font size=-1><em>Matches text against a glob pattern.</em> <a href="#a28"></a><em></em></font><br><br></td></tr>
83 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a29">CallCommandHandler</a> (std::string commandname, char **parameters, int pcnt, <a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
84 <tr><td> </td><td><font size=-1><em>Calls the handler for a command, either implemented by the core or by another module.</em> <a href="#a29"></a><em></em></font><br><br></td></tr>
85 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a30">ChangeHost</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string host)</td></tr>
86 <tr><td> </td><td><font size=-1><em>Change displayed hostname of a user.</em> <a href="#a30"></a><em></em></font><br><br></td></tr>
87 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a31">ChangeGECOS</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string gecos)</td></tr>
88 <tr><td> </td><td><font size=-1><em>Change GECOS (fullname) of a user.</em> <a href="#a31"></a><em></em></font><br><br></td></tr>
89 <tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="classServer.html#a32">IsUlined</a> (std::string server)</td></tr>
90 <tr><td> </td><td><font size=-1><em>Returns true if the servername you give is ulined.</em> <a href="#a32"></a><em></em></font><br><br></td></tr>
92 <hr><a name="_details"></a><h2>Detailed Description</h2>
93 Allows server output and query functions This class contains methods which allow a module to query the state of the irc server, and produce output to users and other servers.
95 All modules should instantiate at least one copy of this class, and use its member functions to perform their tasks.
99 Definition at line <a class="el" href="modules_8h-source.html#l00252">252</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor & Destructor Documentation</h2>
100 <a name="a0" doxytag="Server::Server"></a><p>
101 <table width="100%" cellpadding="2" cellspacing="0" border="0">
104 <table cellpadding="0" cellspacing="0" border="0">
106 <td class="md" nowrap valign="top"> Server::Server </td>
107 <td class="md" valign="top">( </td>
108 <td class="mdname1" valign="top" nowrap> </td>
109 <td class="md" valign="top">) </td>
110 <td class="md" nowrap></td>
117 <table cellspacing=5 cellpadding=0 border=0>
127 Creates a Server object.
129 Definition at line <a class="el" href="modules_8cpp-source.html#l00135">135</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
131 <div class="fragment"><pre>00136 {
136 <a name="a1" doxytag="Server::~Server"></a><p>
137 <table width="100%" cellpadding="2" cellspacing="0" border="0">
140 <table cellpadding="0" cellspacing="0" border="0">
142 <td class="md" nowrap valign="top"> Server::~Server </td>
143 <td class="md" valign="top">( </td>
144 <td class="mdname1" valign="top" nowrap> </td>
145 <td class="md" valign="top">) </td>
146 <td class="md" nowrap><code> [virtual]</code></td>
153 <table cellspacing=5 cellpadding=0 border=0>
163 Destroys a Server object.
165 Definition at line <a class="el" href="modules_8cpp-source.html#l00139">139</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
167 <div class="fragment"><pre>00140 {
172 <hr><h2>Member Function Documentation</h2>
173 <a name="a21" doxytag="Server::AddCommand"></a><p>
174 <table width="100%" cellpadding="2" cellspacing="0" border="0">
177 <table cellpadding="0" cellspacing="0" border="0">
179 <td class="md" nowrap valign="top"> void Server::AddCommand </td>
180 <td class="md" valign="top">( </td>
181 <td class="md" nowrap valign="top">char * </td>
182 <td class="mdname" nowrap> <em>cmd</em>, </td>
187 <td class="md" nowrap>handlerfunc </td>
188 <td class="mdname" nowrap> <em>f</em>, </td>
193 <td class="md" nowrap>char </td>
194 <td class="mdname" nowrap> <em>flags</em>, </td>
199 <td class="md" nowrap>int </td>
200 <td class="mdname" nowrap> <em>minparams</em></td>
204 <td class="md">) </td>
205 <td class="md" colspan="2"><code> [virtual]</code></td>
212 <table cellspacing=5 cellpadding=0 border=0>
220 Adds a command to the command table.
222 This allows modules to add extra commands into the command table. You must place a function within your module which is is of type handlerfunc:<p>
223 typedef void (handlerfunc) (char**, int, userrec*); ... void <a class="el" href="commands_8h.html#a5">handle_kill(char **parameters, int pcnt, userrec *user)</a><p>
224 When the command is typed, the parameters will be placed into the parameters array (similar to argv) and the parameter count will be placed into pcnt (similar to argv). There will never be any less parameters than the 'minparams' value you specified when creating the command. The *user parameter is the class of the user which caused the command to trigger, who will always have the flag you specified in 'flags' when creating the initial command. For example to create an oper only command create the commands with flags='o'.
226 Definition at line <a class="el" href="modules_8cpp-source.html#l00197">197</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
228 References <a class="el" href="modules_8h.html#a13">createcommand()</a>.
230 <div class="fragment"><pre>00198 {
231 00199 <a class="code" href="modules_8h.html#a13">createcommand</a>(cmd,f,flags,minparams);
236 <a name="a20" doxytag="Server::AddExtendedMode"></a><p>
237 <table width="100%" cellpadding="2" cellspacing="0" border="0">
240 <table cellpadding="0" cellspacing="0" border="0">
242 <td class="md" nowrap valign="top"> bool Server::AddExtendedMode </td>
243 <td class="md" valign="top">( </td>
244 <td class="md" nowrap valign="top">char </td>
245 <td class="mdname" nowrap> <em>modechar</em>, </td>
250 <td class="md" nowrap>int </td>
251 <td class="mdname" nowrap> <em>type</em>, </td>
256 <td class="md" nowrap>bool </td>
257 <td class="mdname" nowrap> <em>requires_oper</em>, </td>
262 <td class="md" nowrap>int </td>
263 <td class="mdname" nowrap> <em>params_when_on</em>, </td>
268 <td class="md" nowrap>int </td>
269 <td class="mdname" nowrap> <em>params_when_off</em></td>
273 <td class="md">) </td>
274 <td class="md" colspan="2"><code> [virtual]</code></td>
281 <table cellspacing=5 cellpadding=0 border=0>
289 Adds an extended mode letter which is parsed by a module This allows modules to add extra mode letters, e.g.
291 +x for hostcloak. the "type" parameter is either MT_CHANNEL, MT_CLIENT, or MT_SERVER, to indicate wether the mode is a channel mode, a client mode, or a server mode. requires_oper is used with MT_CLIENT type modes only to indicate the mode can only be set or unset by an oper. If this is used for MT_CHANNEL type modes it is ignored. params_when_on is the number of modes to expect when the mode is turned on (for type MT_CHANNEL only), e.g. with mode +k, this would have a value of 1. the params_when_off value has a similar value to params_when_on, except it indicates the number of parameters to expect when the mode is disabled. Modes which act in a similar way to channel mode +l (e.g. require a parameter to enable, but not to disable) should use this parameter. The function returns false if the mode is unavailable, and will not attempt to allocate another character, as this will confuse users. This also means that as only one module can claim a specific mode character, the core does not need to keep track of which modules own which modes, which speeds up operation of the server. In this version, a mode can have at most one parameter, attempting to use more parameters will have undefined effects.
293 Definition at line <a class="el" href="modules_8cpp-source.html#l00317">317</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
295 References <a class="el" href="modules_8cpp-source.html#l00093">DoAddExtendedMode()</a>, <a class="el" href="modules_8h-source.html#l00018">MT_CLIENT</a>, and <a class="el" href="modules_8h-source.html#l00019">MT_SERVER</a>.
297 <div class="fragment"><pre>00318 {
298 00319 <span class="keywordflow">if</span> (type == <a class="code" href="modules_8h.html#a7">MT_SERVER</a>)
300 00321 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion"</span>);
301 00322 <span class="keywordflow">return</span> <span class="keyword">false</span>;
303 00324 <span class="keywordflow">if</span> (((params_when_on>0) || (params_when_off>0)) && (type == <a class="code" href="modules_8h.html#a6">MT_CLIENT</a>))
305 00326 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Parameters on MT_CLIENT modes are not supported"</span>);
306 00327 <span class="keywordflow">return</span> <span class="keyword">false</span>;
308 00329 <span class="keywordflow">if</span> ((params_when_on>1) || (params_when_off>1))
310 00331 log(DEBUG,<span class="stringliteral">"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported"</span>);
311 00332 <span class="keywordflow">return</span> <span class="keyword">false</span>;
313 00334 <span class="keywordflow">return</span> <a class="code" href="modules_8cpp.html#a8">DoAddExtendedMode</a>(modechar,type,requires_oper,params_when_on,params_when_off);
318 <a name="a29" doxytag="Server::CallCommandHandler"></a><p>
319 <table width="100%" cellpadding="2" cellspacing="0" border="0">
322 <table cellpadding="0" cellspacing="0" border="0">
324 <td class="md" nowrap valign="top"> void Server::CallCommandHandler </td>
325 <td class="md" valign="top">( </td>
326 <td class="md" nowrap valign="top">std::string </td>
327 <td class="mdname" nowrap> <em>commandname</em>, </td>
332 <td class="md" nowrap>char ** </td>
333 <td class="mdname" nowrap> <em>parameters</em>, </td>
338 <td class="md" nowrap>int </td>
339 <td class="mdname" nowrap> <em>pcnt</em>, </td>
344 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
345 <td class="mdname" nowrap> <em>user</em></td>
349 <td class="md">) </td>
350 <td class="md" colspan="2"><code> [virtual]</code></td>
357 <table cellspacing=5 cellpadding=0 border=0>
365 Calls the handler for a command, either implemented by the core or by another module.
367 You can use this function to trigger other commands in the ircd, such as PRIVMSG, JOIN, KICK etc, or even as a method of callback. By defining command names that are untypeable for users on irc (e.g. those which contain a or <br>
368 ) you may use them as callback identifiers. The first parameter to this method is the name of the command handler you wish to call, e.g. PRIVMSG. This will be a command handler previously registered by the core or wih <a class="el" href="classServer.html#a21">AddCommand()</a>. The second parameter is an array of parameters, and the third parameter is a count of parameters in the array. If you do not pass enough parameters to meet the minimum needed by the handler, the functiom will silently ignore it. The final parameter is the user executing the command handler, used for privilage checks, etc.
370 Definition at line <a class="el" href="modules_8cpp-source.html#l00187">187</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
372 <div class="fragment"><pre>00188 {
373 00189 call_handler(commandname.c_str(),parameters,pcnt,user);
378 <a name="a31" doxytag="Server::ChangeGECOS"></a><p>
379 <table width="100%" cellpadding="2" cellspacing="0" border="0">
382 <table cellpadding="0" cellspacing="0" border="0">
384 <td class="md" nowrap valign="top"> void Server::ChangeGECOS </td>
385 <td class="md" valign="top">( </td>
386 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
387 <td class="mdname" nowrap> <em>user</em>, </td>
392 <td class="md" nowrap>std::string </td>
393 <td class="mdname" nowrap> <em>gecos</em></td>
397 <td class="md">) </td>
398 <td class="md" colspan="2"><code> [virtual]</code></td>
405 <table cellspacing=5 cellpadding=0 border=0>
413 Change GECOS (fullname) of a user.
415 You should always call this method to change a user's GECOS rather than writing directly to the fullname member of userrec, as any change applied via this method will be propogated to any linked servers.
417 Definition at line <a class="el" href="modules_8cpp-source.html#l00275">275</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
419 References <a class="el" href="message_8h.html#a10">ChangeName()</a>.
421 <div class="fragment"><pre>00276 {
422 00277 <a class="code" href="message_8h.html#a10">ChangeName</a>(user,gecos.c_str());
427 <a name="a30" doxytag="Server::ChangeHost"></a><p>
428 <table width="100%" cellpadding="2" cellspacing="0" border="0">
431 <table cellpadding="0" cellspacing="0" border="0">
433 <td class="md" nowrap valign="top"> void Server::ChangeHost </td>
434 <td class="md" valign="top">( </td>
435 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
436 <td class="mdname" nowrap> <em>user</em>, </td>
441 <td class="md" nowrap>std::string </td>
442 <td class="mdname" nowrap> <em>host</em></td>
446 <td class="md">) </td>
447 <td class="md" colspan="2"><code> [virtual]</code></td>
454 <table cellspacing=5 cellpadding=0 border=0>
462 Change displayed hostname of a user.
464 You should always call this method to change a user's host rather than writing directly to the dhost member of userrec, as any change applied via this method will be propogated to any linked servers.
466 Definition at line <a class="el" href="modules_8cpp-source.html#l00270">270</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
468 References <a class="el" href="message_8h.html#a11">ChangeDisplayedHost()</a>.
470 <div class="fragment"><pre>00271 {
471 00272 <a class="code" href="message_8h.html#a11">ChangeDisplayedHost</a>(user,host.c_str());
476 <a name="a26" doxytag="Server::ChangeUserNick"></a><p>
477 <table width="100%" cellpadding="2" cellspacing="0" border="0">
480 <table cellpadding="0" cellspacing="0" border="0">
482 <td class="md" nowrap valign="top"> void Server::ChangeUserNick </td>
483 <td class="md" valign="top">( </td>
484 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
485 <td class="mdname" nowrap> <em>user</em>, </td>
490 <td class="md" nowrap>std::string </td>
491 <td class="mdname" nowrap> <em>nickname</em></td>
495 <td class="md">) </td>
496 <td class="md" colspan="2"><code> [virtual]</code></td>
503 <table cellspacing=5 cellpadding=0 border=0>
511 Forces a user nickchange.
513 This command works similarly to SVSNICK, and can be used to implement Q-lines etc. If you specify an invalid nickname, the nick change will be dropped and the target user will receive the error numeric for it.
515 Definition at line <a class="el" href="modules_8cpp-source.html#l00171">171</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
517 <div class="fragment"><pre>00172 {
518 00173 force_nickchange(user,nickname.c_str());
523 <a name="a16" doxytag="Server::ChanMode"></a><p>
524 <table width="100%" cellpadding="2" cellspacing="0" border="0">
527 <table cellpadding="0" cellspacing="0" border="0">
529 <td class="md" nowrap valign="top"> std::string Server::ChanMode </td>
530 <td class="md" valign="top">( </td>
531 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
532 <td class="mdname" nowrap> <em>User</em>, </td>
537 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
538 <td class="mdname" nowrap> <em>Chan</em></td>
542 <td class="md">) </td>
543 <td class="md" colspan="2"><code> [virtual]</code></td>
550 <table cellspacing=5 cellpadding=0 border=0>
558 Attempts to look up a user's privilages on a channel.
560 This function will return a string containing either @, , +, or an empty string, representing the user's privilages upon the channel you specify.
562 Definition at line <a class="el" href="modules_8cpp-source.html#l00295">295</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
564 References <a class="el" href="message_8h.html#a14">cmode()</a>.
566 <div class="fragment"><pre>00296 {
567 00297 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a14">cmode</a>(User,Chan);
572 <a name="a9" doxytag="Server::CommonChannels"></a><p>
573 <table width="100%" cellpadding="2" cellspacing="0" border="0">
576 <table cellpadding="0" cellspacing="0" border="0">
578 <td class="md" nowrap valign="top"> bool Server::CommonChannels </td>
579 <td class="md" valign="top">( </td>
580 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
581 <td class="mdname" nowrap> <em>u1</em>, </td>
586 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
587 <td class="mdname" nowrap> <em>u2</em></td>
591 <td class="md">) </td>
592 <td class="md" colspan="2"><code> [virtual]</code></td>
599 <table cellspacing=5 cellpadding=0 border=0>
607 Returns true if two users share a common channel.
609 This method is used internally by the NICK and QUIT commands, and the <a class="el" href="classServer.html#a10">Server::SendCommon</a> method.
611 Definition at line <a class="el" href="modules_8cpp-source.html#l00248">248</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
613 References <a class="el" href="message_8h.html#a0">common_channels()</a>.
615 <div class="fragment"><pre>00249 {
616 00250 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a0">common_channels</a>(u1,u2) != 0);
621 <a name="a13" doxytag="Server::CountUsers"></a><p>
622 <table width="100%" cellpadding="2" cellspacing="0" border="0">
625 <table cellpadding="0" cellspacing="0" border="0">
627 <td class="md" nowrap valign="top"> int Server::CountUsers </td>
628 <td class="md" valign="top">( </td>
629 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
630 <td class="mdname1" valign="top" nowrap> <em>c</em> </td>
631 <td class="md" valign="top">) </td>
632 <td class="md" nowrap><code> [virtual]</code></td>
639 <table cellspacing=5 cellpadding=0 border=0>
647 Returns a count of the number of users on a channel.
649 This will NEVER be 0, as if the chanrec exists, it will have at least one user in the channel.
651 Definition at line <a class="el" href="modules_8cpp-source.html#l00337">337</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
653 <div class="fragment"><pre>00338 {
654 00339 <span class="keywordflow">return</span> usercount(c);
659 <a name="a15" doxytag="Server::FindChannel"></a><p>
660 <table width="100%" cellpadding="2" cellspacing="0" border="0">
663 <table cellpadding="0" cellspacing="0" border="0">
665 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::FindChannel </td>
666 <td class="md" valign="top">( </td>
667 <td class="md" nowrap valign="top">std::string </td>
668 <td class="mdname1" valign="top" nowrap> <em>channel</em> </td>
669 <td class="md" valign="top">) </td>
670 <td class="md" nowrap><code> [virtual]</code></td>
677 <table cellspacing=5 cellpadding=0 border=0>
685 Attempts to look up a channel and return a pointer to it.
687 This function will return NULL if the channel does not exist.
689 Definition at line <a class="el" href="modules_8cpp-source.html#l00290">290</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
691 <div class="fragment"><pre>00291 {
692 00292 <span class="keywordflow">return</span> FindChan(channel.c_str());
697 <a name="a14" doxytag="Server::FindNick"></a><p>
698 <table width="100%" cellpadding="2" cellspacing="0" border="0">
701 <table cellpadding="0" cellspacing="0" border="0">
703 <td class="md" nowrap valign="top"> <a class="el" href="classuserrec.html">userrec</a> * Server::FindNick </td>
704 <td class="md" valign="top">( </td>
705 <td class="md" nowrap valign="top">std::string </td>
706 <td class="mdname1" valign="top" nowrap> <em>nick</em> </td>
707 <td class="md" valign="top">) </td>
708 <td class="md" nowrap><code> [virtual]</code></td>
715 <table cellspacing=5 cellpadding=0 border=0>
723 Attempts to look up a nick and return a pointer to it.
725 This function will return NULL if the nick does not exist.
727 Definition at line <a class="el" href="modules_8cpp-source.html#l00285">285</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
729 <div class="fragment"><pre>00286 {
730 00287 <span class="keywordflow">return</span> Find(nick);
735 <a name="a19" doxytag="Server::GetAdmin"></a><p>
736 <table width="100%" cellpadding="2" cellspacing="0" border="0">
739 <table cellpadding="0" cellspacing="0" border="0">
741 <td class="md" nowrap valign="top"> <a class="el" href="classAdmin.html">Admin</a> Server::GetAdmin </td>
742 <td class="md" valign="top">( </td>
743 <td class="mdname1" valign="top" nowrap> </td>
744 <td class="md" valign="top">) </td>
745 <td class="md" nowrap><code> [virtual]</code></td>
752 <table cellspacing=5 cellpadding=0 border=0>
760 Returns the information of the server as returned by the /ADMIN command.
762 See the <a class="el" href="classAdmin.html">Admin</a> class for further information of the return value. The members <a class="el" href="classAdmin.html#m2">Admin::Nick</a>, <a class="el" href="classAdmin.html#m1">Admin::Email</a> and <a class="el" href="classAdmin.html#m0">Admin::Name</a> contain the information for the server where the module is loaded.
764 Definition at line <a class="el" href="modules_8cpp-source.html#l00310">310</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
766 <div class="fragment"><pre>00311 {
767 00312 <span class="keywordflow">return</span> <a class="code" href="classAdmin.html">Admin</a>(getadminname(),getadminemail(),getadminnick());
772 <a name="a18" doxytag="Server::GetNetworkName"></a><p>
773 <table width="100%" cellpadding="2" cellspacing="0" border="0">
776 <table cellpadding="0" cellspacing="0" border="0">
778 <td class="md" nowrap valign="top"> std::string Server::GetNetworkName </td>
779 <td class="md" valign="top">( </td>
780 <td class="mdname1" valign="top" nowrap> </td>
781 <td class="md" valign="top">) </td>
782 <td class="md" nowrap><code> [virtual]</code></td>
789 <table cellspacing=5 cellpadding=0 border=0>
797 Returns the network name, global to all linked servers.
801 Definition at line <a class="el" href="modules_8cpp-source.html#l00305">305</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
803 <div class="fragment"><pre>00306 {
804 00307 <span class="keywordflow">return</span> getnetworkname();
809 <a name="a17" doxytag="Server::GetServerName"></a><p>
810 <table width="100%" cellpadding="2" cellspacing="0" border="0">
813 <table cellpadding="0" cellspacing="0" border="0">
815 <td class="md" nowrap valign="top"> std::string Server::GetServerName </td>
816 <td class="md" valign="top">( </td>
817 <td class="mdname1" valign="top" nowrap> </td>
818 <td class="md" valign="top">) </td>
819 <td class="md" nowrap><code> [virtual]</code></td>
826 <table cellspacing=5 cellpadding=0 border=0>
834 Returns the server name of the server where the module is loaded.
838 Definition at line <a class="el" href="modules_8cpp-source.html#l00300">300</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
840 <div class="fragment"><pre>00301 {
841 00302 <span class="keywordflow">return</span> getservername();
846 <a name="a12" doxytag="Server::IsNick"></a><p>
847 <table width="100%" cellpadding="2" cellspacing="0" border="0">
850 <table cellpadding="0" cellspacing="0" border="0">
852 <td class="md" nowrap valign="top"> bool Server::IsNick </td>
853 <td class="md" valign="top">( </td>
854 <td class="md" nowrap valign="top">std::string </td>
855 <td class="mdname1" valign="top" nowrap> <em>nick</em> </td>
856 <td class="md" valign="top">) </td>
857 <td class="md" nowrap><code> [virtual]</code></td>
864 <table cellspacing=5 cellpadding=0 border=0>
872 Returns true if a nick is valid.
874 Nicks for unregistered connections will return false.
876 Definition at line <a class="el" href="modules_8cpp-source.html#l00280">280</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
878 References <a class="el" href="message_8h.html#a13">isnick()</a>.
880 <div class="fragment"><pre>00281 {
881 00282 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a13">isnick</a>(nick.c_str()) != 0);
886 <a name="a32" doxytag="Server::IsUlined"></a><p>
887 <table width="100%" cellpadding="2" cellspacing="0" border="0">
890 <table cellpadding="0" cellspacing="0" border="0">
892 <td class="md" nowrap valign="top"> bool Server::IsUlined </td>
893 <td class="md" valign="top">( </td>
894 <td class="md" nowrap valign="top">std::string </td>
895 <td class="mdname1" valign="top" nowrap> <em>server</em> </td>
896 <td class="md" valign="top">) </td>
897 <td class="md" nowrap><code> [virtual]</code></td>
904 <table cellspacing=5 cellpadding=0 border=0>
912 Returns true if the servername you give is ulined.
914 ULined servers have extra privilages. They are allowed to change nicknames on remote servers, change modes of clients which are on remote servers and set modes of channels where there are no channel operators for that channel on the ulined server, amongst other things. Ulined server data is also broadcast across the mesh at all times as opposed to selectively messaged in the case of normal servers, as many ulined server types (such as services) do not support meshed links and must operate in this manner.
916 Definition at line <a class="el" href="modules_8cpp-source.html#l00182">182</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
918 References <a class="el" href="commands_8h.html#a70">is_uline()</a>.
920 <div class="fragment"><pre>00183 {
921 00184 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a70">is_uline</a>(server.c_str());
926 <a name="a24" doxytag="Server::JoinUserToChannel"></a><p>
927 <table width="100%" cellpadding="2" cellspacing="0" border="0">
930 <table cellpadding="0" cellspacing="0" border="0">
932 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::JoinUserToChannel </td>
933 <td class="md" valign="top">( </td>
934 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
935 <td class="mdname" nowrap> <em>user</em>, </td>
940 <td class="md" nowrap>std::string </td>
941 <td class="mdname" nowrap> <em>cname</em>, </td>
946 <td class="md" nowrap>std::string </td>
947 <td class="mdname" nowrap> <em>key</em></td>
951 <td class="md">) </td>
952 <td class="md" colspan="2"><code> [virtual]</code></td>
959 <table cellspacing=5 cellpadding=0 border=0>
967 Forces a user to join a channel.
969 This is similar to svsjoin and can be used to implement redirection, etc. On success, the return value is a valid pointer to a chanrec* of the channel the user was joined to. On failure, the result is NULL.
971 Definition at line <a class="el" href="modules_8cpp-source.html#l00161">161</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
973 <div class="fragment"><pre>00162 {
974 00163 <span class="keywordflow">return</span> add_channel(user,cname.c_str(),key.c_str(),<span class="keyword">true</span>);
979 <a name="a3" doxytag="Server::Log"></a><p>
980 <table width="100%" cellpadding="2" cellspacing="0" border="0">
983 <table cellpadding="0" cellspacing="0" border="0">
985 <td class="md" nowrap valign="top"> void Server::Log </td>
986 <td class="md" valign="top">( </td>
987 <td class="md" nowrap valign="top">int </td>
988 <td class="mdname" nowrap> <em>level</em>, </td>
993 <td class="md" nowrap>std::string </td>
994 <td class="mdname" nowrap> <em>s</em></td>
998 <td class="md">) </td>
999 <td class="md" colspan="2"><code> [virtual]</code></td>
1006 <table cellspacing=5 cellpadding=0 border=0>
1014 Writes a log string.
1016 This method writes a line of text to the log. If the level given is lower than the level given in the configuration, this command has no effect.
1018 Definition at line <a class="el" href="modules_8cpp-source.html#l00192">192</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1020 <div class="fragment"><pre>00193 {
1021 00194 log(level,<span class="stringliteral">"%s"</span>,s.c_str());
1026 <a name="a28" doxytag="Server::MatchText"></a><p>
1027 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1030 <table cellpadding="0" cellspacing="0" border="0">
1032 <td class="md" nowrap valign="top"> bool Server::MatchText </td>
1033 <td class="md" valign="top">( </td>
1034 <td class="md" nowrap valign="top">std::string </td>
1035 <td class="mdname" nowrap> <em>sliteral</em>, </td>
1040 <td class="md" nowrap>std::string </td>
1041 <td class="mdname" nowrap> <em>spattern</em></td>
1045 <td class="md">) </td>
1046 <td class="md" colspan="2"><code> [virtual]</code></td>
1053 <table cellspacing=5 cellpadding=0 border=0>
1061 Matches text against a glob pattern.
1063 Uses the ircd's internal matching function to match string against a globbing pattern, e.g. *!*@*.com Returns true if the literal successfully matches the pattern, false if otherwise.
1065 Definition at line <a class="el" href="modules_8cpp-source.html#l00148">148</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1067 <div class="fragment"><pre>00149 {
1068 00150 <span class="keywordtype">char</span> literal[MAXBUF],pattern[MAXBUF];
1069 00151 strncpy(literal,sliteral.c_str(),MAXBUF);
1070 00152 strncpy(pattern,spattern.c_str(),MAXBUF);
1071 00153 <span class="keywordflow">return</span> match(literal,pattern);
1076 <a name="a25" doxytag="Server::PartUserFromChannel"></a><p>
1077 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1080 <table cellpadding="0" cellspacing="0" border="0">
1082 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::PartUserFromChannel </td>
1083 <td class="md" valign="top">( </td>
1084 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1085 <td class="mdname" nowrap> <em>user</em>, </td>
1090 <td class="md" nowrap>std::string </td>
1091 <td class="mdname" nowrap> <em>cname</em>, </td>
1096 <td class="md" nowrap>std::string </td>
1097 <td class="mdname" nowrap> <em>reason</em></td>
1101 <td class="md">) </td>
1102 <td class="md" colspan="2"><code> [virtual]</code></td>
1109 <table cellspacing=5 cellpadding=0 border=0>
1117 Forces a user to part a channel.
1119 This is similar to svspart and can be used to implement redirection, etc. Although the return value of this function is a pointer to a channel record, the returned data is undefined and should not be read or written to. This behaviour may be changed in a future version.
1121 Definition at line <a class="el" href="modules_8cpp-source.html#l00166">166</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1123 <div class="fragment"><pre>00167 {
1124 00168 <span class="keywordflow">return</span> del_channel(user,cname.c_str(),reason.c_str(),<span class="keyword">false</span>);
1129 <a name="a27" doxytag="Server::QuitUser"></a><p>
1130 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1133 <table cellpadding="0" cellspacing="0" border="0">
1135 <td class="md" nowrap valign="top"> void Server::QuitUser </td>
1136 <td class="md" valign="top">( </td>
1137 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1138 <td class="mdname" nowrap> <em>user</em>, </td>
1143 <td class="md" nowrap>std::string </td>
1144 <td class="mdname" nowrap> <em>reason</em></td>
1148 <td class="md">) </td>
1149 <td class="md" colspan="2"><code> [virtual]</code></td>
1156 <table cellspacing=5 cellpadding=0 border=0>
1164 Forces a user to quit with the specified reason.
1166 To the user, it will appear as if they typed /QUIT themselves, except for the fact that this function may bypass the quit prefix specified in the config file.<p>
1168 Once you call this function, userrec* user will immediately become INVALID. You MUST NOT write to, or read from this pointer after calling the QuitUser method UNDER ANY CIRCUMSTANCES! The best course of action after calling this method is to immediately bail from your handler.
1170 Definition at line <a class="el" href="modules_8cpp-source.html#l00176">176</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1172 References <a class="el" href="users_8h-source.html#l00091">userrec::nick</a>, and <a class="el" href="message_8h.html#a19">send_network_quit()</a>.
1174 <div class="fragment"><pre>00177 {
1175 00178 <a class="code" href="message_8h.html#a19">send_network_quit</a>(user-><a class="code" href="classuserrec.html#m0">nick</a>,reason.c_str());
1176 00179 kill_link(user,reason.c_str());
1181 <a name="a4" doxytag="Server::Send"></a><p>
1182 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1185 <table cellpadding="0" cellspacing="0" border="0">
1187 <td class="md" nowrap valign="top"> void Server::Send </td>
1188 <td class="md" valign="top">( </td>
1189 <td class="md" nowrap valign="top">int </td>
1190 <td class="mdname" nowrap> <em>Socket</em>, </td>
1195 <td class="md" nowrap>std::string </td>
1196 <td class="mdname" nowrap> <em>s</em></td>
1200 <td class="md">) </td>
1201 <td class="md" colspan="2"><code> [virtual]</code></td>
1208 <table cellspacing=5 cellpadding=0 border=0>
1216 Sends a line of text down a TCP/IP socket.
1218 This method writes a line of text to an established socket, cutting it to 510 characters plus a carriage return and linefeed if required.
1220 Definition at line <a class="el" href="modules_8cpp-source.html#l00207">207</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1222 <div class="fragment"><pre>00208 {
1223 00209 Write(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
1228 <a name="a8" doxytag="Server::SendChannel"></a><p>
1229 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1232 <table cellpadding="0" cellspacing="0" border="0">
1234 <td class="md" nowrap valign="top"> void Server::SendChannel </td>
1235 <td class="md" valign="top">( </td>
1236 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1237 <td class="mdname" nowrap> <em>User</em>, </td>
1242 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
1243 <td class="mdname" nowrap> <em>Channel</em>, </td>
1248 <td class="md" nowrap>std::string </td>
1249 <td class="mdname" nowrap> <em>s</em>, </td>
1254 <td class="md" nowrap>bool </td>
1255 <td class="mdname" nowrap> <em>IncludeSender</em></td>
1259 <td class="md">) </td>
1260 <td class="md" colspan="2"><code> [virtual]</code></td>
1267 <table cellspacing=5 cellpadding=0 border=0>
1275 Sends text from a user to a channel (mulicast).
1277 This method writes a line of text to a channel, with the given user's nick/ident /host combination prepended, as used in PRIVMSG etc commands (see RFC 1459). If the IncludeSender flag is set, then the text is also sent back to the user from which it originated, as seen in MODE (see RFC 1459).
1279 Definition at line <a class="el" href="modules_8cpp-source.html#l00236">236</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1281 <div class="fragment"><pre>00237 {
1282 00238 <span class="keywordflow">if</span> (IncludeSender)
1284 00240 WriteChannel(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
1286 00242 <span class="keywordflow">else</span>
1288 00244 ChanExceptSender(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
1294 <a name="a10" doxytag="Server::SendCommon"></a><p>
1295 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1298 <table cellpadding="0" cellspacing="0" border="0">
1300 <td class="md" nowrap valign="top"> void Server::SendCommon </td>
1301 <td class="md" valign="top">( </td>
1302 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1303 <td class="mdname" nowrap> <em>User</em>, </td>
1308 <td class="md" nowrap>std::string </td>
1309 <td class="mdname" nowrap> <em>text</em>, </td>
1314 <td class="md" nowrap>bool </td>
1315 <td class="mdname" nowrap> <em>IncludeSender</em></td>
1319 <td class="md">) </td>
1320 <td class="md" colspan="2"><code> [virtual]</code></td>
1327 <table cellspacing=5 cellpadding=0 border=0>
1335 Sends text from a user to one or more channels (mulicast).
1337 This method writes a line of text to all users which share a common channel with a given user, with the user's nick/ident/host combination prepended, as used in PRIVMSG etc commands (see RFC 1459). If the IncludeSender flag is set, then the text is also sent back to the user from which it originated, as seen in NICK (see RFC 1459). Otherwise, it is only sent to the other recipients, as seen in QUIT.
1339 Definition at line <a class="el" href="modules_8cpp-source.html#l00253">253</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1341 <div class="fragment"><pre>00254 {
1342 00255 <span class="keywordflow">if</span> (IncludeSender)
1344 00257 WriteCommon(User,<span class="stringliteral">"%s"</span>,text.c_str());
1346 00259 <span class="keywordflow">else</span>
1348 00261 WriteCommonExcept(User,<span class="stringliteral">"%s"</span>,text.c_str());
1354 <a name="a6" doxytag="Server::SendFrom"></a><p>
1355 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1358 <table cellpadding="0" cellspacing="0" border="0">
1360 <td class="md" nowrap valign="top"> void Server::SendFrom </td>
1361 <td class="md" valign="top">( </td>
1362 <td class="md" nowrap valign="top">int </td>
1363 <td class="mdname" nowrap> <em>Socket</em>, </td>
1368 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
1369 <td class="mdname" nowrap> <em>User</em>, </td>
1374 <td class="md" nowrap>std::string </td>
1375 <td class="mdname" nowrap> <em>s</em></td>
1379 <td class="md">) </td>
1380 <td class="md" colspan="2"><code> [virtual]</code></td>
1387 <table cellspacing=5 cellpadding=0 border=0>
1395 Sends text from a user to a socket.
1397 This method writes a line of text to an established socket, with the given user's nick/ident /host combination prepended, as used in PRIVSG etc commands (see RFC 1459)
1399 Definition at line <a class="el" href="modules_8cpp-source.html#l00217">217</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1401 <div class="fragment"><pre>00218 {
1402 00219 WriteFrom(Socket,User,<span class="stringliteral">"%s"</span>,s.c_str());
1407 <a name="a22" doxytag="Server::SendMode"></a><p>
1408 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1411 <table cellpadding="0" cellspacing="0" border="0">
1413 <td class="md" nowrap valign="top"> void Server::SendMode </td>
1414 <td class="md" valign="top">( </td>
1415 <td class="md" nowrap valign="top">char ** </td>
1416 <td class="mdname" nowrap> <em>parameters</em>, </td>
1421 <td class="md" nowrap>int </td>
1422 <td class="mdname" nowrap> <em>pcnt</em>, </td>
1427 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
1428 <td class="mdname" nowrap> <em>user</em></td>
1432 <td class="md">) </td>
1433 <td class="md" colspan="2"><code> [virtual]</code></td>
1440 <table cellspacing=5 cellpadding=0 border=0>
1450 you must format the parameters array with the target, modes and parameters for those modes.<p>
1453 modes[0] = ChannelName;<p>
1455 modes[2] = user->nick;<p>
1456 Srv->SendMode(modes,3,user);<p>
1457 The modes will originate from the server where the command was issued, however responses (e.g. numerics) will be sent to the user you provide as the third parameter. You must be sure to get the number of parameters correct in the pcnt parameter otherwise you could leave your server in an unstable state!
1459 Definition at line <a class="el" href="modules_8cpp-source.html#l00202">202</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1461 References <a class="el" href="modules_8h.html#a14">server_mode()</a>.
1463 <div class="fragment"><pre>00203 {
1464 00204 <a class="code" href="modules_8h.html#a14">server_mode</a>(parameters,pcnt,user);
1469 <a name="a2" doxytag="Server::SendOpers"></a><p>
1470 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1473 <table cellpadding="0" cellspacing="0" border="0">
1475 <td class="md" nowrap valign="top"> void Server::SendOpers </td>
1476 <td class="md" valign="top">( </td>
1477 <td class="md" nowrap valign="top">std::string </td>
1478 <td class="mdname1" valign="top" nowrap> <em>s</em> </td>
1479 <td class="md" valign="top">) </td>
1480 <td class="md" nowrap><code> [virtual]</code></td>
1487 <table cellspacing=5 cellpadding=0 border=0>
1495 Sends text to all opers.
1497 This method sends a server notice to all opers with the usermode +s.
1499 Definition at line <a class="el" href="modules_8cpp-source.html#l00143">143</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1501 <div class="fragment"><pre>00144 {
1502 00145 WriteOpers(<span class="stringliteral">"%s"</span>,s.c_str());
1507 <a name="a5" doxytag="Server::SendServ"></a><p>
1508 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1511 <table cellpadding="0" cellspacing="0" border="0">
1513 <td class="md" nowrap valign="top"> void Server::SendServ </td>
1514 <td class="md" valign="top">( </td>
1515 <td class="md" nowrap valign="top">int </td>
1516 <td class="mdname" nowrap> <em>Socket</em>, </td>
1521 <td class="md" nowrap>std::string </td>
1522 <td class="mdname" nowrap> <em>s</em></td>
1526 <td class="md">) </td>
1527 <td class="md" colspan="2"><code> [virtual]</code></td>
1534 <table cellspacing=5 cellpadding=0 border=0>
1542 Sends text from the server to a socket.
1544 This method writes a line of text to an established socket, with the servername prepended as used by numerics (see RFC 1459)
1546 Definition at line <a class="el" href="modules_8cpp-source.html#l00212">212</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1548 <div class="fragment"><pre>00213 {
1549 00214 WriteServ(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
1554 <a name="a7" doxytag="Server::SendTo"></a><p>
1555 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1558 <table cellpadding="0" cellspacing="0" border="0">
1560 <td class="md" nowrap valign="top"> void Server::SendTo </td>
1561 <td class="md" valign="top">( </td>
1562 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1563 <td class="mdname" nowrap> <em>Source</em>, </td>
1568 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
1569 <td class="mdname" nowrap> <em>Dest</em>, </td>
1574 <td class="md" nowrap>std::string </td>
1575 <td class="mdname" nowrap> <em>s</em></td>
1579 <td class="md">) </td>
1580 <td class="md" colspan="2"><code> [virtual]</code></td>
1587 <table cellspacing=5 cellpadding=0 border=0>
1595 Sends text from a user to another user.
1597 This method writes a line of text to a user, with a user's nick/ident /host combination prepended, as used in PRIVMSG etc commands (see RFC 1459) If you specify NULL as the source, then the data will originate from the local server, e.g. instead of:<p>
1599 The format will become:<p>
1600 :localserver TEXT<p>
1601 Which is useful for numerics and server notices to single users, etc.
1603 Definition at line <a class="el" href="modules_8cpp-source.html#l00222">222</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1605 References <a class="el" href="connection_8h-source.html#l00166">connection::fd</a>.
1607 <div class="fragment"><pre>00223 {
1608 00224 <span class="keywordflow">if</span> (!Source)
1610 00226 <span class="comment">// if source is NULL, then the message originates from the local server</span>
1611 00227 Write(Dest-><a class="code" href="classconnection.html#m0">fd</a>,<span class="stringliteral">":%s %s"</span>,this->GetServerName().c_str(),s.c_str());
1613 00229 <span class="keywordflow">else</span>
1615 00231 <span class="comment">// otherwise it comes from the user specified</span>
1616 00232 WriteTo(Source,Dest,<span class="stringliteral">"%s"</span>,s.c_str());
1622 <a name="a23" doxytag="Server::SendToModeMask"></a><p>
1623 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1626 <table cellpadding="0" cellspacing="0" border="0">
1628 <td class="md" nowrap valign="top"> void Server::SendToModeMask </td>
1629 <td class="md" valign="top">( </td>
1630 <td class="md" nowrap valign="top">std::string </td>
1631 <td class="mdname" nowrap> <em>modes</em>, </td>
1636 <td class="md" nowrap>int </td>
1637 <td class="mdname" nowrap> <em>flags</em>, </td>
1642 <td class="md" nowrap>std::string </td>
1643 <td class="mdname" nowrap> <em>text</em></td>
1647 <td class="md">) </td>
1648 <td class="md" colspan="2"><code> [virtual]</code></td>
1655 <table cellspacing=5 cellpadding=0 border=0>
1663 Sends to all users matching a mode mask You must specify one or more usermodes as the first parameter.
1665 These can be RFC specified modes such as +i, or module provided modes, including ones provided by your own module. In the second parameter you must place a flag value which indicates wether the modes you have given will be logically ANDed or OR'ed. You may use one of either WM_AND or WM_OR. for example, if you were to use:<p>
1666 Serv->SendToModeMask("xi", WM_OR, "m00");<p>
1667 Then the text 'm00' will be sent to all users with EITHER mode x or i. Conversely if you used WM_AND, the user must have both modes set to receive the message.
1669 Definition at line <a class="el" href="modules_8cpp-source.html#l00156">156</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1671 <div class="fragment"><pre>00157 {
1672 00158 WriteMode(modes.c_str(),flags,<span class="stringliteral">"%s"</span>,text.c_str());
1677 <a name="a11" doxytag="Server::SendWallops"></a><p>
1678 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1681 <table cellpadding="0" cellspacing="0" border="0">
1683 <td class="md" nowrap valign="top"> void Server::SendWallops </td>
1684 <td class="md" valign="top">( </td>
1685 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1686 <td class="mdname" nowrap> <em>User</em>, </td>
1691 <td class="md" nowrap>std::string </td>
1692 <td class="mdname" nowrap> <em>text</em></td>
1696 <td class="md">) </td>
1697 <td class="md" colspan="2"><code> [virtual]</code></td>
1704 <table cellspacing=5 cellpadding=0 border=0>
1712 Sends a WALLOPS message.
1714 This method writes a WALLOPS message to all users with the +w flag, originating from the specified user.
1716 Definition at line <a class="el" href="modules_8cpp-source.html#l00265">265</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1718 <div class="fragment"><pre>00266 {
1719 00267 WriteWallOps(User,<span class="keyword">false</span>,<span class="stringliteral">"%s"</span>,text.c_str());
1724 <hr>The documentation for this class was generated from the following files:<ul>
1725 <li><a class="el" href="modules_8h-source.html">modules.h</a><li><a class="el" href="modules_8cpp-source.html">modules.cpp</a></ul>
1726 <hr><address style="align: right;"><small>Generated on Thu Apr 29 16:22:11 2004 for InspIRCd by
1727 <a href="http://www.doxygen.org/index.html">
1728 <img src="doxygen.png" alt="doxygen" align="middle" border=0
1729 width=110 height=53></a>1.3-rc3 </small></address>