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">
6 <!-- Generated by Doxygen 1.3.3 -->
7 <div class="qindex"><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></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>
11 <code>#include <<a class="el" href="modules_8h-source.html">modules.h</a>></code>
13 Inherits <a class="el" href="classclassbase.html">classbase</a>.
15 <a href="classServer-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
17 <tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
18 <tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a0">Server</a> ()</td></tr>
20 <tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a1">~Server</a> ()</td></tr>
23 <tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a2">SendOpers</a> (std::string s)</td></tr>
26 <tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a3">Log</a> (int level, std::string s)</td></tr>
29 <tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a4">Send</a> (int Socket, std::string s)</td></tr>
32 <tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a5">SendServ</a> (int Socket, std::string s)</td></tr>
35 <tr><td class="mdescLeft"> </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 </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>
38 <tr><td class="mdescLeft"> </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 </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>
41 <tr><td class="mdescLeft"> </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 </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>
44 <tr><td class="mdescLeft"> </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 </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>
47 <tr><td class="mdescLeft"> </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 </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>
50 <tr><td class="mdescLeft"> </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 </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>
53 <tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a12">IsNick</a> (std::string nick)</td></tr>
56 <tr><td class="mdescLeft"> </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 </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>
59 <tr><td class="mdescLeft"> </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> * </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a14">FindNick</a> (std::string nick)</td></tr>
62 <tr><td class="mdescLeft"> </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> * </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a15">FindChannel</a> (std::string channel)</td></tr>
65 <tr><td class="mdescLeft"> </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 </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>
68 <tr><td class="mdescLeft"> </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 </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>
71 <tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a18">GetServerName</a> ()</td></tr>
74 <tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a19">GetNetworkName</a> ()</td></tr>
77 <tr><td class="mdescLeft"> </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> </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a20">GetAdmin</a> ()</td></tr>
80 <tr><td class="mdescLeft"> </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 </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>
83 <tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a22">AddExtendedListMode</a> (char modechar)</td></tr>
86 <tr><td class="mdescLeft"> </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 </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>
89 <tr><td class="mdescLeft"> </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 </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>
92 <tr><td class="mdescLeft"> </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 </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>
95 <tr><td class="mdescLeft"> </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> * </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>
98 <tr><td class="mdescLeft"> </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> * </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>
101 <tr><td class="mdescLeft"> </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 </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>
104 <tr><td class="mdescLeft"> </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 </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>
107 <tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a30">MatchText</a> (std::string sliteral, std::string spattern)</td></tr>
110 <tr><td class="mdescLeft"> </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 </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>
113 <tr><td class="mdescLeft"> </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 </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>
116 <tr><td class="mdescLeft"> </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 </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>
119 <tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a34">IsUlined</a> (std::string server)</td></tr>
122 <tr><td class="mdescLeft"> </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#a33">chanuserlist</a> </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>
125 <tr><td class="mdescLeft"> </td><td class="mdescRight">Fetches the userlist of a channel. </em> <a href="#a35"></a><em><br><br></td></tr>
126 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a36">UserToPseudo</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string message)</td></tr>
128 <tr><td class="mdescLeft"> </td><td class="mdescRight">Remove a user's connection to the irc server, but leave their client in existence in the user hash. </em> <a href="#a36"></a><em><br><br></td></tr>
129 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a37">PseudoToUser</a> (<a class="el" href="classuserrec.html">userrec</a> *alive, <a class="el" href="classuserrec.html">userrec</a> *zombie, std::string message)</td></tr>
131 <tr><td class="mdescLeft"> </td><td class="mdescRight">This user takes one user, and switches their file descriptor with another user, so that one user "becomes" the other. </em> <a href="#a37"></a><em><br><br></td></tr>
132 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a38">AddGLine</a> (long duration, std::string source, std::string reason, std::string hostmask)</td></tr>
134 <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a G-line The G-line is propogated to all of the servers in the mesh and enforced as soon as it is added. </em> <a href="#a38"></a><em><br><br></td></tr>
135 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a39">AddQLine</a> (long duration, std::string source, std::string reason, std::string nickname)</td></tr>
137 <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a Q-line The Q-line is propogated to all of the servers in the mesh and enforced as soon as it is added. </em> <a href="#a39"></a><em><br><br></td></tr>
138 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a40">AddZLine</a> (long duration, std::string source, std::string reason, std::string ipaddr)</td></tr>
140 <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a Z-line The Z-line is propogated to all of the servers in the mesh and enforced as soon as it is added. </em> <a href="#a40"></a><em><br><br></td></tr>
141 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a41">AddKLine</a> (long duration, std::string source, std::string reason, std::string hostmask)</td></tr>
143 <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a K-line The K-line is enforced as soon as it is added. </em> <a href="#a41"></a><em><br><br></td></tr>
144 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a42">AddELine</a> (long duration, std::string source, std::string reason, std::string hostmask)</td></tr>
146 <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a E-line The E-line is enforced as soon as it is added. </em> <a href="#a42"></a><em><br><br></td></tr>
147 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a43">DelGLine</a> (std::string hostmask)</td></tr>
149 <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a G-Line from all servers on the mesh. </em> <a href="#a43"></a><em><br><br></td></tr>
150 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a44">DelQLine</a> (std::string nickname)</td></tr>
152 <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a Q-Line from all servers on the mesh. </em> <a href="#a44"></a><em><br><br></td></tr>
153 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a45">DelZLine</a> (std::string ipaddr)</td></tr>
155 <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a Z-Line from all servers on the mesh. </em> <a href="#a45"></a><em><br><br></td></tr>
156 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a46">DelKLine</a> (std::string hostmask)</td></tr>
158 <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a local K-Line. </em> <a href="#a46"></a><em><br><br></td></tr>
159 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a47">DelELine</a> (std::string hostmask)</td></tr>
161 <tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a local E-Line. </em> <a href="#a47"></a><em><br><br></td></tr>
162 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual long </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a48">CalcDuration</a> (std::string duration)</td></tr>
164 <tr><td class="mdescLeft"> </td><td class="mdescRight">Calculates a duration This method will take a string containing a formatted duration (e.g. </em> <a href="#a48"></a><em><br><br></td></tr>
166 <hr><a name="_details"></a><h2>Detailed Description</h2>
167 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.
169 All modules should instantiate at least one copy of this class, and use its member functions to perform their tasks.
173 Definition at line <a class="el" href="modules_8h-source.html#l00395">395</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor & Destructor Documentation</h2>
174 <a name="a0" doxytag="Server::Server"></a><p>
175 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
178 <table cellpadding="0" cellspacing="0" border="0">
180 <td class="md" nowrap valign="top"> Server::Server </td>
181 <td class="md" valign="top">( </td>
182 <td class="mdname1" valign="top" nowrap> </td>
183 <td class="md" valign="top"> ) </td>
184 <td class="md" nowrap></td>
191 <table cellspacing=5 cellpadding=0 border=0>
201 Creates a Server object.
203 Definition at line <a class="el" href="modules_8cpp-source.html#l00340">340</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
205 <div class="fragment"><pre>00341 {
210 <a name="a1" doxytag="Server::~Server"></a><p>
211 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
214 <table cellpadding="0" cellspacing="0" border="0">
216 <td class="md" nowrap valign="top"> Server::~<a class="el" href="classServer.html">Server</a> </td>
217 <td class="md" valign="top">( </td>
218 <td class="mdname1" valign="top" nowrap> </td>
219 <td class="md" valign="top"> ) </td>
220 <td class="md" nowrap><code> [virtual]</code></td>
227 <table cellspacing=5 cellpadding=0 border=0>
237 Destroys a Server object.
239 Definition at line <a class="el" href="modules_8cpp-source.html#l00344">344</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
241 <div class="fragment"><pre>00345 {
246 <hr><h2>Member Function Documentation</h2>
247 <a name="a23" doxytag="Server::AddCommand"></a><p>
248 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
251 <table cellpadding="0" cellspacing="0" border="0">
253 <td class="md" nowrap valign="top"> void Server::AddCommand </td>
254 <td class="md" valign="top">( </td>
255 <td class="md" nowrap valign="top">char * </td>
256 <td class="mdname" nowrap> <em>cmd</em>, </td>
261 <td class="md" nowrap>handlerfunc </td>
262 <td class="mdname" nowrap> <em>f</em>, </td>
267 <td class="md" nowrap>char </td>
268 <td class="mdname" nowrap> <em>flags</em>, </td>
273 <td class="md" nowrap>int </td>
274 <td class="mdname" nowrap> <em>minparams</em>, </td>
279 <td class="md" nowrap>char * </td>
280 <td class="mdname" nowrap> <em>source</em></td>
284 <td class="md">) </td>
285 <td class="md" colspan="2"><code> [virtual]</code></td>
292 <table cellspacing=5 cellpadding=0 border=0>
300 Adds a command to the command table.
302 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>
303 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>
304 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.
306 Definition at line <a class="el" href="modules_8cpp-source.html#l00421">421</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
308 References <a class="el" href="modules_8h.html#a35">createcommand()</a>.
310 <div class="fragment"><pre>00422 {
311 00423 <a class="code" href="modules_8h.html#a35">createcommand</a>(cmd,f,flags,minparams,source);
316 <a name="a42" doxytag="Server::AddELine"></a><p>
317 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
320 <table cellpadding="0" cellspacing="0" border="0">
322 <td class="md" nowrap valign="top"> void Server::AddELine </td>
323 <td class="md" valign="top">( </td>
324 <td class="md" nowrap valign="top">long </td>
325 <td class="mdname" nowrap> <em>duration</em>, </td>
330 <td class="md" nowrap>std::string </td>
331 <td class="mdname" nowrap> <em>source</em>, </td>
336 <td class="md" nowrap>std::string </td>
337 <td class="mdname" nowrap> <em>reason</em>, </td>
342 <td class="md" nowrap>std::string </td>
343 <td class="mdname" nowrap> <em>hostmask</em></td>
347 <td class="md">) </td>
348 <td class="md" colspan="2"><code> [virtual]</code></td>
355 <table cellspacing=5 cellpadding=0 border=0>
363 Adds a E-line The E-line is enforced as soon as it is added.
365 The duration must be in seconds, however you can use the <a class="el" href="classServer.html#a48">Server::CalcDuration</a> method to convert durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used to indicate who or what sent the data, usually this is the nickname of a person, or a server name.
367 Definition at line <a class="el" href="modules_8cpp-source.html#l00639">639</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
369 References <a class="el" href="xline_8h.html#a5">add_eline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
371 <div class="fragment"><pre>00640 {
372 00641 <a class="code" href="xline_8h.html#a5">add_eline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
377 <a name="a22" doxytag="Server::AddExtendedListMode"></a><p>
378 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
381 <table cellpadding="0" cellspacing="0" border="0">
383 <td class="md" nowrap valign="top"> bool Server::AddExtendedListMode </td>
384 <td class="md" valign="top">( </td>
385 <td class="md" nowrap valign="top">char </td>
386 <td class="mdname1" valign="top" nowrap> <em>modechar</em> </td>
387 <td class="md" valign="top"> ) </td>
388 <td class="md" nowrap><code> [virtual]</code></td>
395 <table cellspacing=5 cellpadding=0 border=0>
403 Adds an extended mode letter which is parsed by a module and handled in a list fashion.
405 This call is used to implement modes like +q and +a. The characteristics of these modes are as follows:<p>
406 (1) They are ALWAYS on channels, not on users, therefore their type is MT_CHANNEL<p>
407 (2) They always take exactly one parameter when being added or removed<p>
408 (3) They can be set multiple times, usually on users in channels<p>
409 (4) The mode and its parameter are NOT stored in the channels modes structure<p>
410 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.
412 Definition at line <a class="el" href="modules_8cpp-source.html#l00566">566</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
414 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>.
416 <div class="fragment"><pre>00567 {
417 00568 <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);
418 00569 <span class="keywordflow">if</span> (res)
419 00570 <a class="code" href="modules_8cpp.html#a58">ModeMakeList</a>(modechar);
420 00571 <span class="keywordflow">return</span> res;
425 <a name="a21" doxytag="Server::AddExtendedMode"></a><p>
426 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
429 <table cellpadding="0" cellspacing="0" border="0">
431 <td class="md" nowrap valign="top"> bool Server::AddExtendedMode </td>
432 <td class="md" valign="top">( </td>
433 <td class="md" nowrap valign="top">char </td>
434 <td class="mdname" nowrap> <em>modechar</em>, </td>
439 <td class="md" nowrap>int </td>
440 <td class="mdname" nowrap> <em>type</em>, </td>
445 <td class="md" nowrap>bool </td>
446 <td class="mdname" nowrap> <em>requires_oper</em>, </td>
451 <td class="md" nowrap>int </td>
452 <td class="mdname" nowrap> <em>params_when_on</em>, </td>
457 <td class="md" nowrap>int </td>
458 <td class="mdname" nowrap> <em>params_when_off</em></td>
462 <td class="md">) </td>
463 <td class="md" colspan="2"><code> [virtual]</code></td>
470 <table cellspacing=5 cellpadding=0 border=0>
478 Adds an extended mode letter which is parsed by a module.
480 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.
482 Definition at line <a class="el" href="modules_8cpp-source.html#l00546">546</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
484 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>.
486 <div class="fragment"><pre>00547 {
487 00548 <span class="keywordflow">if</span> (type == <a class="code" href="modules_8h.html#a7">MT_SERVER</a>)
489 00550 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion"</span>);
490 00551 <span class="keywordflow">return</span> <span class="keyword">false</span>;
492 00553 <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>))
494 00555 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Parameters on MT_CLIENT modes are not supported"</span>);
495 00556 <span class="keywordflow">return</span> <span class="keyword">false</span>;
497 00558 <span class="keywordflow">if</span> ((params_when_on>1) || (params_when_off>1))
499 00560 log(DEBUG,<span class="stringliteral">"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported"</span>);
500 00561 <span class="keywordflow">return</span> <span class="keyword">false</span>;
502 00563 <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);
507 <a name="a38" doxytag="Server::AddGLine"></a><p>
508 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
511 <table cellpadding="0" cellspacing="0" border="0">
513 <td class="md" nowrap valign="top"> void Server::AddGLine </td>
514 <td class="md" valign="top">( </td>
515 <td class="md" nowrap valign="top">long </td>
516 <td class="mdname" nowrap> <em>duration</em>, </td>
521 <td class="md" nowrap>std::string </td>
522 <td class="mdname" nowrap> <em>source</em>, </td>
527 <td class="md" nowrap>std::string </td>
528 <td class="mdname" nowrap> <em>reason</em>, </td>
533 <td class="md" nowrap>std::string </td>
534 <td class="mdname" nowrap> <em>hostmask</em></td>
538 <td class="md">) </td>
539 <td class="md" colspan="2"><code> [virtual]</code></td>
546 <table cellspacing=5 cellpadding=0 border=0>
554 Adds a G-line The G-line is propogated to all of the servers in the mesh and enforced as soon as it is added.
556 The duration must be in seconds, however you can use the <a class="el" href="classServer.html#a48">Server::CalcDuration</a> method to convert durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used to indicate who or what sent the data, usually this is the nickname of a person, or a server name.
558 Definition at line <a class="el" href="modules_8cpp-source.html#l00619">619</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
560 References <a class="el" href="xline_8h.html#a1">add_gline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
562 <div class="fragment"><pre>00620 {
563 00621 <a class="code" href="xline_8h.html#a1">add_gline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
568 <a name="a41" doxytag="Server::AddKLine"></a><p>
569 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
572 <table cellpadding="0" cellspacing="0" border="0">
574 <td class="md" nowrap valign="top"> void Server::AddKLine </td>
575 <td class="md" valign="top">( </td>
576 <td class="md" nowrap valign="top">long </td>
577 <td class="mdname" nowrap> <em>duration</em>, </td>
582 <td class="md" nowrap>std::string </td>
583 <td class="mdname" nowrap> <em>source</em>, </td>
588 <td class="md" nowrap>std::string </td>
589 <td class="mdname" nowrap> <em>reason</em>, </td>
594 <td class="md" nowrap>std::string </td>
595 <td class="mdname" nowrap> <em>hostmask</em></td>
599 <td class="md">) </td>
600 <td class="md" colspan="2"><code> [virtual]</code></td>
607 <table cellspacing=5 cellpadding=0 border=0>
615 Adds a K-line The K-line is enforced as soon as it is added.
617 The duration must be in seconds, however you can use the <a class="el" href="classServer.html#a48">Server::CalcDuration</a> method to convert durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used to indicate who or what sent the data, usually this is the nickname of a person, or a server name.
619 Definition at line <a class="el" href="modules_8cpp-source.html#l00634">634</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
621 References <a class="el" href="xline_8h.html#a4">add_kline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
623 <div class="fragment"><pre>00635 {
624 00636 <a class="code" href="xline_8h.html#a4">add_kline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
629 <a name="a39" doxytag="Server::AddQLine"></a><p>
630 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
633 <table cellpadding="0" cellspacing="0" border="0">
635 <td class="md" nowrap valign="top"> void Server::AddQLine </td>
636 <td class="md" valign="top">( </td>
637 <td class="md" nowrap valign="top">long </td>
638 <td class="mdname" nowrap> <em>duration</em>, </td>
643 <td class="md" nowrap>std::string </td>
644 <td class="mdname" nowrap> <em>source</em>, </td>
649 <td class="md" nowrap>std::string </td>
650 <td class="mdname" nowrap> <em>reason</em>, </td>
655 <td class="md" nowrap>std::string </td>
656 <td class="mdname" nowrap> <em>nickname</em></td>
660 <td class="md">) </td>
661 <td class="md" colspan="2"><code> [virtual]</code></td>
668 <table cellspacing=5 cellpadding=0 border=0>
676 Adds a Q-line The Q-line is propogated to all of the servers in the mesh and enforced as soon as it is added.
678 The duration must be in seconds, however you can use the <a class="el" href="classServer.html#a48">Server::CalcDuration</a> method to convert durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used to indicate who or what sent the data, usually this is the nickname of a person, or a server name.
680 Definition at line <a class="el" href="modules_8cpp-source.html#l00624">624</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
682 References <a class="el" href="xline_8h.html#a2">add_qline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
684 <div class="fragment"><pre>00625 {
685 00626 <a class="code" href="xline_8h.html#a2">add_qline</a>(duration, source.c_str(), reason.c_str(), nickname.c_str());
690 <a name="a40" doxytag="Server::AddZLine"></a><p>
691 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
694 <table cellpadding="0" cellspacing="0" border="0">
696 <td class="md" nowrap valign="top"> void Server::AddZLine </td>
697 <td class="md" valign="top">( </td>
698 <td class="md" nowrap valign="top">long </td>
699 <td class="mdname" nowrap> <em>duration</em>, </td>
704 <td class="md" nowrap>std::string </td>
705 <td class="mdname" nowrap> <em>source</em>, </td>
710 <td class="md" nowrap>std::string </td>
711 <td class="mdname" nowrap> <em>reason</em>, </td>
716 <td class="md" nowrap>std::string </td>
717 <td class="mdname" nowrap> <em>ipaddr</em></td>
721 <td class="md">) </td>
722 <td class="md" colspan="2"><code> [virtual]</code></td>
729 <table cellspacing=5 cellpadding=0 border=0>
737 Adds a Z-line The Z-line is propogated to all of the servers in the mesh and enforced as soon as it is added.
739 The duration must be in seconds, however you can use the <a class="el" href="classServer.html#a48">Server::CalcDuration</a> method to convert durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used to indicate who or what sent the data, usually this is the nickname of a person, or a server name.
741 Definition at line <a class="el" href="modules_8cpp-source.html#l00629">629</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
743 References <a class="el" href="xline_8h.html#a3">add_zline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
745 <div class="fragment"><pre>00630 {
746 00631 <a class="code" href="xline_8h.html#a3">add_zline</a>(duration, source.c_str(), reason.c_str(), ipaddr.c_str());
751 <a name="a48" doxytag="Server::CalcDuration"></a><p>
752 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
755 <table cellpadding="0" cellspacing="0" border="0">
757 <td class="md" nowrap valign="top"> long Server::CalcDuration </td>
758 <td class="md" valign="top">( </td>
759 <td class="md" nowrap valign="top">std::string </td>
760 <td class="mdname1" valign="top" nowrap> <em>duration</em> </td>
761 <td class="md" valign="top"> ) </td>
762 <td class="md" nowrap><code> [virtual]</code></td>
769 <table cellspacing=5 cellpadding=0 border=0>
777 Calculates a duration This method will take a string containing a formatted duration (e.g.
779 "1w2d") and return its value as a total number of seconds. This is the same function used internally by /GLINE etc to set the ban times.
781 Definition at line <a class="el" href="modules_8cpp-source.html#l00669">669</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
783 References <a class="el" href="commands_8h.html#a75">duration()</a>.
785 <div class="fragment"><pre>00670 {
786 00671 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a75">duration</a>(delta.c_str());
791 <a name="a31" doxytag="Server::CallCommandHandler"></a><p>
792 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
795 <table cellpadding="0" cellspacing="0" border="0">
797 <td class="md" nowrap valign="top"> void Server::CallCommandHandler </td>
798 <td class="md" valign="top">( </td>
799 <td class="md" nowrap valign="top">std::string </td>
800 <td class="mdname" nowrap> <em>commandname</em>, </td>
805 <td class="md" nowrap>char ** </td>
806 <td class="mdname" nowrap> <em>parameters</em>, </td>
811 <td class="md" nowrap>int </td>
812 <td class="mdname" nowrap> <em>pcnt</em>, </td>
817 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
818 <td class="mdname" nowrap> <em>user</em></td>
822 <td class="md">) </td>
823 <td class="md" colspan="2"><code> [virtual]</code></td>
830 <table cellspacing=5 cellpadding=0 border=0>
838 Calls the handler for a command, either implemented by the core or by another module.
840 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>
841 ) 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.
843 Definition at line <a class="el" href="modules_8cpp-source.html#l00411">411</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
845 <div class="fragment"><pre>00412 {
846 00413 call_handler(commandname.c_str(),parameters,pcnt,user);
851 <a name="a33" doxytag="Server::ChangeGECOS"></a><p>
852 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
855 <table cellpadding="0" cellspacing="0" border="0">
857 <td class="md" nowrap valign="top"> void Server::ChangeGECOS </td>
858 <td class="md" valign="top">( </td>
859 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
860 <td class="mdname" nowrap> <em>user</em>, </td>
865 <td class="md" nowrap>std::string </td>
866 <td class="mdname" nowrap> <em>gecos</em></td>
870 <td class="md">) </td>
871 <td class="md" colspan="2"><code> [virtual]</code></td>
878 <table cellspacing=5 cellpadding=0 border=0>
886 Change GECOS (fullname) of a user.
888 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.
890 Definition at line <a class="el" href="modules_8cpp-source.html#l00499">499</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
892 References <a class="el" href="message_8h.html#a10">ChangeName()</a>.
894 <div class="fragment"><pre>00500 {
895 00501 <a class="code" href="message_8h.html#a10">ChangeName</a>(user,gecos.c_str());
900 <a name="a32" doxytag="Server::ChangeHost"></a><p>
901 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
904 <table cellpadding="0" cellspacing="0" border="0">
906 <td class="md" nowrap valign="top"> void Server::ChangeHost </td>
907 <td class="md" valign="top">( </td>
908 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
909 <td class="mdname" nowrap> <em>user</em>, </td>
914 <td class="md" nowrap>std::string </td>
915 <td class="mdname" nowrap> <em>host</em></td>
919 <td class="md">) </td>
920 <td class="md" colspan="2"><code> [virtual]</code></td>
927 <table cellspacing=5 cellpadding=0 border=0>
935 Change displayed hostname of a user.
937 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.
939 Definition at line <a class="el" href="modules_8cpp-source.html#l00494">494</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
941 References <a class="el" href="message_8h.html#a11">ChangeDisplayedHost()</a>.
943 <div class="fragment"><pre>00495 {
944 00496 <a class="code" href="message_8h.html#a11">ChangeDisplayedHost</a>(user,host.c_str());
949 <a name="a28" doxytag="Server::ChangeUserNick"></a><p>
950 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
953 <table cellpadding="0" cellspacing="0" border="0">
955 <td class="md" nowrap valign="top"> void Server::ChangeUserNick </td>
956 <td class="md" valign="top">( </td>
957 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
958 <td class="mdname" nowrap> <em>user</em>, </td>
963 <td class="md" nowrap>std::string </td>
964 <td class="mdname" nowrap> <em>nickname</em></td>
968 <td class="md">) </td>
969 <td class="md" colspan="2"><code> [virtual]</code></td>
976 <table cellspacing=5 cellpadding=0 border=0>
984 Forces a user nickchange.
986 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.
988 Definition at line <a class="el" href="modules_8cpp-source.html#l00395">395</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
990 <div class="fragment"><pre>00396 {
991 00397 force_nickchange(user,nickname.c_str());
996 <a name="a16" doxytag="Server::ChanMode"></a><p>
997 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1000 <table cellpadding="0" cellspacing="0" border="0">
1002 <td class="md" nowrap valign="top"> std::string Server::ChanMode </td>
1003 <td class="md" valign="top">( </td>
1004 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1005 <td class="mdname" nowrap> <em>User</em>, </td>
1010 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
1011 <td class="mdname" nowrap> <em>Chan</em></td>
1015 <td class="md">) </td>
1016 <td class="md" colspan="2"><code> [virtual]</code></td>
1023 <table cellspacing=5 cellpadding=0 border=0>
1031 Attempts to look up a user's privilages on a channel.
1033 This function will return a string containing either @, , +, or an empty string, representing the user's privilages upon the channel you specify.
1035 Definition at line <a class="el" href="modules_8cpp-source.html#l00519">519</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1037 References <a class="el" href="message_8h.html#a14">cmode()</a>.
1039 <div class="fragment"><pre>00520 {
1040 00521 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a14">cmode</a>(User,Chan);
1045 <a name="a9" doxytag="Server::CommonChannels"></a><p>
1046 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1049 <table cellpadding="0" cellspacing="0" border="0">
1051 <td class="md" nowrap valign="top"> bool Server::CommonChannels </td>
1052 <td class="md" valign="top">( </td>
1053 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1054 <td class="mdname" nowrap> <em>u1</em>, </td>
1059 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
1060 <td class="mdname" nowrap> <em>u2</em></td>
1064 <td class="md">) </td>
1065 <td class="md" colspan="2"><code> [virtual]</code></td>
1072 <table cellspacing=5 cellpadding=0 border=0>
1080 Returns true if two users share a common channel.
1082 This method is used internally by the NICK and QUIT commands, and the <a class="el" href="classServer.html#a10">Server::SendCommon</a> method.
1084 Definition at line <a class="el" href="modules_8cpp-source.html#l00472">472</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1086 References <a class="el" href="message_8h.html#a0">common_channels()</a>.
1088 <div class="fragment"><pre>00473 {
1089 00474 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a0">common_channels</a>(u1,u2) != 0);
1094 <a name="a13" doxytag="Server::CountUsers"></a><p>
1095 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1098 <table cellpadding="0" cellspacing="0" border="0">
1100 <td class="md" nowrap valign="top"> int Server::CountUsers </td>
1101 <td class="md" valign="top">( </td>
1102 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
1103 <td class="mdname1" valign="top" nowrap> <em>c</em> </td>
1104 <td class="md" valign="top"> ) </td>
1105 <td class="md" nowrap><code> [virtual]</code></td>
1112 <table cellspacing=5 cellpadding=0 border=0>
1120 Returns a count of the number of users on a channel.
1122 This will NEVER be 0, as if the chanrec exists, it will have at least one user in the channel.
1124 Definition at line <a class="el" href="modules_8cpp-source.html#l00574">574</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1126 <div class="fragment"><pre>00575 {
1127 00576 <span class="keywordflow">return</span> usercount(c);
1132 <a name="a47" doxytag="Server::DelELine"></a><p>
1133 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1136 <table cellpadding="0" cellspacing="0" border="0">
1138 <td class="md" nowrap valign="top"> bool Server::DelELine </td>
1139 <td class="md" valign="top">( </td>
1140 <td class="md" nowrap valign="top">std::string </td>
1141 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1142 <td class="md" valign="top"> ) </td>
1143 <td class="md" nowrap><code> [virtual]</code></td>
1150 <table cellspacing=5 cellpadding=0 border=0>
1158 Deletes a local E-Line.
1162 Definition at line <a class="el" href="modules_8cpp-source.html#l00664">664</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1164 References <a class="el" href="xline_8h.html#a10">del_eline()</a>.
1166 <div class="fragment"><pre>00665 {
1167 00666 <a class="code" href="xline_8h.html#a10">del_eline</a>(hostmask.c_str());
1172 <a name="a43" doxytag="Server::DelGLine"></a><p>
1173 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1176 <table cellpadding="0" cellspacing="0" border="0">
1178 <td class="md" nowrap valign="top"> bool Server::DelGLine </td>
1179 <td class="md" valign="top">( </td>
1180 <td class="md" nowrap valign="top">std::string </td>
1181 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1182 <td class="md" valign="top"> ) </td>
1183 <td class="md" nowrap><code> [virtual]</code></td>
1190 <table cellspacing=5 cellpadding=0 border=0>
1198 Deletes a G-Line from all servers on the mesh.
1202 Definition at line <a class="el" href="modules_8cpp-source.html#l00644">644</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1204 References <a class="el" href="xline_8h.html#a6">del_gline()</a>.
1206 <div class="fragment"><pre>00645 {
1207 00646 <a class="code" href="xline_8h.html#a6">del_gline</a>(hostmask.c_str());
1212 <a name="a46" doxytag="Server::DelKLine"></a><p>
1213 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1216 <table cellpadding="0" cellspacing="0" border="0">
1218 <td class="md" nowrap valign="top"> bool Server::DelKLine </td>
1219 <td class="md" valign="top">( </td>
1220 <td class="md" nowrap valign="top">std::string </td>
1221 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1222 <td class="md" valign="top"> ) </td>
1223 <td class="md" nowrap><code> [virtual]</code></td>
1230 <table cellspacing=5 cellpadding=0 border=0>
1238 Deletes a local K-Line.
1242 Definition at line <a class="el" href="modules_8cpp-source.html#l00659">659</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1244 References <a class="el" href="xline_8h.html#a9">del_kline()</a>.
1246 <div class="fragment"><pre>00660 {
1247 00661 <a class="code" href="xline_8h.html#a9">del_kline</a>(hostmask.c_str());
1252 <a name="a44" doxytag="Server::DelQLine"></a><p>
1253 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1256 <table cellpadding="0" cellspacing="0" border="0">
1258 <td class="md" nowrap valign="top"> bool Server::DelQLine </td>
1259 <td class="md" valign="top">( </td>
1260 <td class="md" nowrap valign="top">std::string </td>
1261 <td class="mdname1" valign="top" nowrap> <em>nickname</em> </td>
1262 <td class="md" valign="top"> ) </td>
1263 <td class="md" nowrap><code> [virtual]</code></td>
1270 <table cellspacing=5 cellpadding=0 border=0>
1278 Deletes a Q-Line from all servers on the mesh.
1282 Definition at line <a class="el" href="modules_8cpp-source.html#l00649">649</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1284 References <a class="el" href="xline_8h.html#a7">del_qline()</a>.
1286 <div class="fragment"><pre>00650 {
1287 00651 <a class="code" href="xline_8h.html#a7">del_qline</a>(nickname.c_str());
1292 <a name="a45" doxytag="Server::DelZLine"></a><p>
1293 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1296 <table cellpadding="0" cellspacing="0" border="0">
1298 <td class="md" nowrap valign="top"> bool Server::DelZLine </td>
1299 <td class="md" valign="top">( </td>
1300 <td class="md" nowrap valign="top">std::string </td>
1301 <td class="mdname1" valign="top" nowrap> <em>ipaddr</em> </td>
1302 <td class="md" valign="top"> ) </td>
1303 <td class="md" nowrap><code> [virtual]</code></td>
1310 <table cellspacing=5 cellpadding=0 border=0>
1318 Deletes a Z-Line from all servers on the mesh.
1322 Definition at line <a class="el" href="modules_8cpp-source.html#l00654">654</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1324 References <a class="el" href="xline_8h.html#a8">del_zline()</a>.
1326 <div class="fragment"><pre>00655 {
1327 00656 <a class="code" href="xline_8h.html#a8">del_zline</a>(ipaddr.c_str());
1332 <a name="a15" doxytag="Server::FindChannel"></a><p>
1333 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1336 <table cellpadding="0" cellspacing="0" border="0">
1338 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::FindChannel </td>
1339 <td class="md" valign="top">( </td>
1340 <td class="md" nowrap valign="top">std::string </td>
1341 <td class="mdname1" valign="top" nowrap> <em>channel</em> </td>
1342 <td class="md" valign="top"> ) </td>
1343 <td class="md" nowrap><code> [virtual]</code></td>
1350 <table cellspacing=5 cellpadding=0 border=0>
1358 Attempts to look up a channel and return a pointer to it.
1360 This function will return NULL if the channel does not exist.
1362 Definition at line <a class="el" href="modules_8cpp-source.html#l00514">514</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1364 <div class="fragment"><pre>00515 {
1365 00516 <span class="keywordflow">return</span> FindChan(channel.c_str());
1370 <a name="a14" doxytag="Server::FindNick"></a><p>
1371 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1374 <table cellpadding="0" cellspacing="0" border="0">
1376 <td class="md" nowrap valign="top"> <a class="el" href="classuserrec.html">userrec</a> * Server::FindNick </td>
1377 <td class="md" valign="top">( </td>
1378 <td class="md" nowrap valign="top">std::string </td>
1379 <td class="mdname1" valign="top" nowrap> <em>nick</em> </td>
1380 <td class="md" valign="top"> ) </td>
1381 <td class="md" nowrap><code> [virtual]</code></td>
1388 <table cellspacing=5 cellpadding=0 border=0>
1396 Attempts to look up a nick and return a pointer to it.
1398 This function will return NULL if the nick does not exist.
1400 Definition at line <a class="el" href="modules_8cpp-source.html#l00509">509</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1402 <div class="fragment"><pre>00510 {
1403 00511 <span class="keywordflow">return</span> Find(nick);
1408 <a name="a20" doxytag="Server::GetAdmin"></a><p>
1409 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1412 <table cellpadding="0" cellspacing="0" border="0">
1414 <td class="md" nowrap valign="top"> <a class="el" href="classAdmin.html">Admin</a> Server::GetAdmin </td>
1415 <td class="md" valign="top">( </td>
1416 <td class="mdname1" valign="top" nowrap> </td>
1417 <td class="md" valign="top"> ) </td>
1418 <td class="md" nowrap><code> [virtual]</code></td>
1425 <table cellspacing=5 cellpadding=0 border=0>
1433 Returns the information of the server as returned by the /ADMIN command.
1435 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.
1437 Definition at line <a class="el" href="modules_8cpp-source.html#l00539">539</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1439 <div class="fragment"><pre>00540 {
1440 00541 <span class="keywordflow">return</span> <a class="code" href="classAdmin.html">Admin</a>(getadminname(),getadminemail(),getadminnick());
1445 <a name="a19" doxytag="Server::GetNetworkName"></a><p>
1446 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1449 <table cellpadding="0" cellspacing="0" border="0">
1451 <td class="md" nowrap valign="top"> std::string Server::GetNetworkName </td>
1452 <td class="md" valign="top">( </td>
1453 <td class="mdname1" valign="top" nowrap> </td>
1454 <td class="md" valign="top"> ) </td>
1455 <td class="md" nowrap><code> [virtual]</code></td>
1462 <table cellspacing=5 cellpadding=0 border=0>
1470 Returns the network name, global to all linked servers.
1474 Definition at line <a class="el" href="modules_8cpp-source.html#l00534">534</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1476 <div class="fragment"><pre>00535 {
1477 00536 <span class="keywordflow">return</span> getnetworkname();
1482 <a name="a18" doxytag="Server::GetServerName"></a><p>
1483 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1486 <table cellpadding="0" cellspacing="0" border="0">
1488 <td class="md" nowrap valign="top"> std::string Server::GetServerName </td>
1489 <td class="md" valign="top">( </td>
1490 <td class="mdname1" valign="top" nowrap> </td>
1491 <td class="md" valign="top"> ) </td>
1492 <td class="md" nowrap><code> [virtual]</code></td>
1499 <table cellspacing=5 cellpadding=0 border=0>
1507 Returns the server name of the server where the module is loaded.
1511 Definition at line <a class="el" href="modules_8cpp-source.html#l00529">529</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1513 <div class="fragment"><pre>00530 {
1514 00531 <span class="keywordflow">return</span> getservername();
1519 <a name="a35" doxytag="Server::GetUsers"></a><p>
1520 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1523 <table cellpadding="0" cellspacing="0" border="0">
1525 <td class="md" nowrap valign="top"> <a class="el" href="modules_8h.html#a33">chanuserlist</a> Server::GetUsers </td>
1526 <td class="md" valign="top">( </td>
1527 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
1528 <td class="mdname1" valign="top" nowrap> <em>chan</em> </td>
1529 <td class="md" valign="top"> ) </td>
1530 <td class="md" nowrap><code> [virtual]</code></td>
1537 <table cellspacing=5 cellpadding=0 border=0>
1545 Fetches the userlist of a channel.
1547 This function must be here and not a member of userrec or chanrec due to include constraints.
1549 Definition at line <a class="el" href="modules_8cpp-source.html#l00376">376</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1551 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>.
1553 <div class="fragment"><pre>00377 {
1554 00378 <a class="code" href="modules_8h.html#a33">chanuserlist</a> userl;
1555 00379 userl.clear();
1556 00380 <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++)
1558 00382 <span class="keywordflow">if</span> (i->second)
1560 00384 <span class="keywordflow">if</span> (<a class="code" href="message_8h.html#a16">has_channel</a>(i->second,chan))
1562 00386 <span class="keywordflow">if</span> (<a class="code" href="message_8h.html#a13">isnick</a>(i->second->nick))
1564 00388 userl.push_back(i->second);
1569 00393 <span class="keywordflow">return</span> userl;
1574 <a name="a12" doxytag="Server::IsNick"></a><p>
1575 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1578 <table cellpadding="0" cellspacing="0" border="0">
1580 <td class="md" nowrap valign="top"> bool Server::IsNick </td>
1581 <td class="md" valign="top">( </td>
1582 <td class="md" nowrap valign="top">std::string </td>
1583 <td class="mdname1" valign="top" nowrap> <em>nick</em> </td>
1584 <td class="md" valign="top"> ) </td>
1585 <td class="md" nowrap><code> [virtual]</code></td>
1592 <table cellspacing=5 cellpadding=0 border=0>
1600 Returns true if a nick is valid.
1602 Nicks for unregistered connections will return false.
1604 Definition at line <a class="el" href="modules_8cpp-source.html#l00504">504</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1606 References <a class="el" href="message_8h.html#a13">isnick()</a>.
1608 <div class="fragment"><pre>00505 {
1609 00506 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a13">isnick</a>(nick.c_str()) != 0);
1614 <a name="a17" doxytag="Server::IsOnChannel"></a><p>
1615 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1618 <table cellpadding="0" cellspacing="0" border="0">
1620 <td class="md" nowrap valign="top"> bool Server::IsOnChannel </td>
1621 <td class="md" valign="top">( </td>
1622 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1623 <td class="mdname" nowrap> <em>User</em>, </td>
1628 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
1629 <td class="mdname" nowrap> <em>Chan</em></td>
1633 <td class="md">) </td>
1634 <td class="md" colspan="2"><code> [virtual]</code></td>
1641 <table cellspacing=5 cellpadding=0 border=0>
1649 Checks if a user is on a channel.
1651 This function will return true or false to indicate if user 'User' is on channel 'Chan'.
1653 Definition at line <a class="el" href="modules_8cpp-source.html#l00524">524</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1655 References <a class="el" href="message_8h.html#a16">has_channel()</a>.
1657 <div class="fragment"><pre>00525 {
1658 00526 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a16">has_channel</a>(User,Chan);
1663 <a name="a34" doxytag="Server::IsUlined"></a><p>
1664 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1667 <table cellpadding="0" cellspacing="0" border="0">
1669 <td class="md" nowrap valign="top"> bool Server::IsUlined </td>
1670 <td class="md" valign="top">( </td>
1671 <td class="md" nowrap valign="top">std::string </td>
1672 <td class="mdname1" valign="top" nowrap> <em>server</em> </td>
1673 <td class="md" valign="top"> ) </td>
1674 <td class="md" nowrap><code> [virtual]</code></td>
1681 <table cellspacing=5 cellpadding=0 border=0>
1689 Returns true if the servername you give is ulined.
1691 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.
1693 Definition at line <a class="el" href="modules_8cpp-source.html#l00406">406</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1695 References <a class="el" href="commands_8h.html#a74">is_uline()</a>.
1697 <div class="fragment"><pre>00407 {
1698 00408 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a74">is_uline</a>(server.c_str());
1703 <a name="a26" doxytag="Server::JoinUserToChannel"></a><p>
1704 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1707 <table cellpadding="0" cellspacing="0" border="0">
1709 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::JoinUserToChannel </td>
1710 <td class="md" valign="top">( </td>
1711 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1712 <td class="mdname" nowrap> <em>user</em>, </td>
1717 <td class="md" nowrap>std::string </td>
1718 <td class="mdname" nowrap> <em>cname</em>, </td>
1723 <td class="md" nowrap>std::string </td>
1724 <td class="mdname" nowrap> <em>key</em></td>
1728 <td class="md">) </td>
1729 <td class="md" colspan="2"><code> [virtual]</code></td>
1736 <table cellspacing=5 cellpadding=0 border=0>
1744 Forces a user to join a channel.
1746 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.
1748 Definition at line <a class="el" href="modules_8cpp-source.html#l00366">366</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1750 <div class="fragment"><pre>00367 {
1751 00368 <span class="keywordflow">return</span> add_channel(user,cname.c_str(),key.c_str(),<span class="keyword">true</span>);
1756 <a name="a3" doxytag="Server::Log"></a><p>
1757 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1760 <table cellpadding="0" cellspacing="0" border="0">
1762 <td class="md" nowrap valign="top"> void Server::Log </td>
1763 <td class="md" valign="top">( </td>
1764 <td class="md" nowrap valign="top">int </td>
1765 <td class="mdname" nowrap> <em>level</em>, </td>
1770 <td class="md" nowrap>std::string </td>
1771 <td class="mdname" nowrap> <em>s</em></td>
1775 <td class="md">) </td>
1776 <td class="md" colspan="2"><code> [virtual]</code></td>
1783 <table cellspacing=5 cellpadding=0 border=0>
1791 Writes a log string.
1793 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.
1795 Definition at line <a class="el" href="modules_8cpp-source.html#l00416">416</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1797 <div class="fragment"><pre>00417 {
1798 00418 log(level,<span class="stringliteral">"%s"</span>,s.c_str());
1803 <a name="a30" doxytag="Server::MatchText"></a><p>
1804 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1807 <table cellpadding="0" cellspacing="0" border="0">
1809 <td class="md" nowrap valign="top"> bool Server::MatchText </td>
1810 <td class="md" valign="top">( </td>
1811 <td class="md" nowrap valign="top">std::string </td>
1812 <td class="mdname" nowrap> <em>sliteral</em>, </td>
1817 <td class="md" nowrap>std::string </td>
1818 <td class="mdname" nowrap> <em>spattern</em></td>
1822 <td class="md">) </td>
1823 <td class="md" colspan="2"><code> [virtual]</code></td>
1830 <table cellspacing=5 cellpadding=0 border=0>
1838 Matches text against a glob pattern.
1840 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.
1842 Definition at line <a class="el" href="modules_8cpp-source.html#l00353">353</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1844 <div class="fragment"><pre>00354 {
1845 00355 <span class="keywordtype">char</span> literal[MAXBUF],pattern[MAXBUF];
1846 00356 strlcpy(literal,sliteral.c_str(),MAXBUF);
1847 00357 strlcpy(pattern,spattern.c_str(),MAXBUF);
1848 00358 <span class="keywordflow">return</span> match(literal,pattern);
1853 <a name="a27" doxytag="Server::PartUserFromChannel"></a><p>
1854 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1857 <table cellpadding="0" cellspacing="0" border="0">
1859 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::PartUserFromChannel </td>
1860 <td class="md" valign="top">( </td>
1861 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1862 <td class="mdname" nowrap> <em>user</em>, </td>
1867 <td class="md" nowrap>std::string </td>
1868 <td class="mdname" nowrap> <em>cname</em>, </td>
1873 <td class="md" nowrap>std::string </td>
1874 <td class="mdname" nowrap> <em>reason</em></td>
1878 <td class="md">) </td>
1879 <td class="md" colspan="2"><code> [virtual]</code></td>
1886 <table cellspacing=5 cellpadding=0 border=0>
1894 Forces a user to part a channel.
1896 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.
1898 Definition at line <a class="el" href="modules_8cpp-source.html#l00371">371</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1900 <div class="fragment"><pre>00372 {
1901 00373 <span class="keywordflow">return</span> del_channel(user,cname.c_str(),reason.c_str(),<span class="keyword">false</span>);
1906 <a name="a37" doxytag="Server::PseudoToUser"></a><p>
1907 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1910 <table cellpadding="0" cellspacing="0" border="0">
1912 <td class="md" nowrap valign="top"> bool Server::PseudoToUser </td>
1913 <td class="md" valign="top">( </td>
1914 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1915 <td class="mdname" nowrap> <em>alive</em>, </td>
1920 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
1921 <td class="mdname" nowrap> <em>zombie</em>, </td>
1926 <td class="md" nowrap>std::string </td>
1927 <td class="mdname" nowrap> <em>message</em></td>
1931 <td class="md">) </td>
1932 <td class="md" colspan="2"><code> [virtual]</code></td>
1939 <table cellspacing=5 cellpadding=0 border=0>
1947 This user takes one user, and switches their file descriptor with another user, so that one user "becomes" the other.
1949 The user in 'alive' is booted off the server with the given message. The user referred to by 'zombie' should have previously been locked with Server::ZombifyUser, otherwise stale sockets and file descriptor leaks can occur. After this call, the pointer to alive will be invalid, and the pointer to zombie will be equivalent in effect to the old pointer to alive.
1951 Definition at line <a class="el" href="modules_8cpp-source.html#l00589">589</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1953 References <a class="el" href="channels_8h-source.html#l00213">ucrec::channel</a>, <a class="el" href="users_8h-source.html#l00127">userrec::chans</a>, <a class="el" href="channels_8h-source.html#l00111">chanrec::created</a>, <a class="el" href="connection_8h-source.html#l00178">connection::fd</a>, <a class="el" href="modules_8h-source.html#l00099">FD_MAGIC_NUMBER</a>, <a class="el" href="connection_8h-source.html#l00182">connection::host</a>, <a class="el" href="users_8h-source.html#l00110">userrec::ident</a>, <a class="el" href="channels_8h-source.html#l00099">chanrec::name</a>, <a class="el" href="users_8h-source.html#l00106">userrec::nick</a>, <a class="el" href="channels_8h-source.html#l00119">chanrec::setby</a>, <a class="el" href="channels_8h-source.html#l00108">chanrec::topic</a>, and <a class="el" href="channels_8h-source.html#l00115">chanrec::topicset</a>.
1955 <div class="fragment"><pre>00590 {
1956 00591 zombie-><a class="code" href="classconnection.html#o0">fd</a> = alive-><a class="code" href="classconnection.html#o0">fd</a>;
1957 00592 alive-><a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="modules_8h.html#a26">FD_MAGIC_NUMBER</a>;
1958 00593 Write(zombie-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">":%s!%s@%s NICK %s"</span>,alive-><a class="code" href="classuserrec.html#o0">nick</a>,alive-><a class="code" href="classuserrec.html#o1">ident</a>,alive-><a class="code" href="classconnection.html#o1">host</a>,zombie-><a class="code" href="classuserrec.html#o0">nick</a>);
1959 00594 kill_link(alive,message.c_str());
1960 00595 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i != MAXCHANS; i++)
1962 00597 <span class="keywordflow">if</span> (zombie-><a class="code" href="classuserrec.html#o5">chans</a>[i].<a class="code" href="classucrec.html#o1">channel</a> != NULL)
1964 00599 <span class="keywordflow">if</span> (zombie-><a class="code" href="classuserrec.html#o5">chans</a>[i].<a class="code" href="classucrec.html#o1">channel</a>-><a class="code" href="classchanrec.html#o0">name</a>)
1966 00601 <a class="code" href="classchanrec.html">chanrec</a>* Ptr = zombie-><a class="code" href="classuserrec.html#o5">chans</a>[i].<a class="code" href="classucrec.html#o1">channel</a>;
1967 00602 WriteFrom(zombie-><a class="code" href="classconnection.html#o0">fd</a>,zombie,<span class="stringliteral">"JOIN %s"</span>,Ptr-><a class="code" href="classchanrec.html#o0">name</a>);
1968 00603 <span class="keywordflow">if</span> (Ptr-><a class="code" href="classchanrec.html#o4">topicset</a>)
1970 00605 WriteServ(zombie-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">"332 %s %s :%s"</span>, zombie-><a class="code" href="classuserrec.html#o0">nick</a>, Ptr-><a class="code" href="classchanrec.html#o0">name</a>, Ptr-><a class="code" href="classchanrec.html#o2">topic</a>);
1971 00606 WriteServ(zombie-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">"333 %s %s %s %d"</span>, zombie-><a class="code" href="classuserrec.html#o0">nick</a>, Ptr-><a class="code" href="classchanrec.html#o0">name</a>, Ptr-><a class="code" href="classchanrec.html#o5">setby</a>, Ptr-><a class="code" href="classchanrec.html#o4">topicset</a>);
1973 00608 userlist(zombie,Ptr);
1974 00609 WriteServ(zombie-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">"366 %s %s :End of /NAMES list."</span>, zombie-><a class="code" href="classuserrec.html#o0">nick</a>, Ptr-><a class="code" href="classchanrec.html#o0">name</a>);
1975 00610 WriteServ(zombie-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">"324 %s %s +%s"</span>,zombie-><a class="code" href="classuserrec.html#o0">nick</a>, Ptr-><a class="code" href="classchanrec.html#o0">name</a>,chanmodes(Ptr));
1976 00611 WriteServ(zombie-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">"329 %s %s %d"</span>, zombie-><a class="code" href="classuserrec.html#o0">nick</a>, Ptr-><a class="code" href="classchanrec.html#o0">name</a>, Ptr-><a class="code" href="classchanrec.html#o3">created</a>);
1986 <a name="a29" doxytag="Server::QuitUser"></a><p>
1987 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1990 <table cellpadding="0" cellspacing="0" border="0">
1992 <td class="md" nowrap valign="top"> void Server::QuitUser </td>
1993 <td class="md" valign="top">( </td>
1994 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1995 <td class="mdname" nowrap> <em>user</em>, </td>
2000 <td class="md" nowrap>std::string </td>
2001 <td class="mdname" nowrap> <em>reason</em></td>
2005 <td class="md">) </td>
2006 <td class="md" colspan="2"><code> [virtual]</code></td>
2013 <table cellspacing=5 cellpadding=0 border=0>
2021 Forces a user to quit with the specified reason.
2023 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>
2025 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.
2027 Definition at line <a class="el" href="modules_8cpp-source.html#l00400">400</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2029 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>.
2031 <div class="fragment"><pre>00401 {
2032 00402 <a class="code" href="message_8h.html#a19">send_network_quit</a>(user-><a class="code" href="classuserrec.html#o0">nick</a>,reason.c_str());
2033 00403 kill_link(user,reason.c_str());
2038 <a name="a4" doxytag="Server::Send"></a><p>
2039 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2042 <table cellpadding="0" cellspacing="0" border="0">
2044 <td class="md" nowrap valign="top"> void Server::Send </td>
2045 <td class="md" valign="top">( </td>
2046 <td class="md" nowrap valign="top">int </td>
2047 <td class="mdname" nowrap> <em>Socket</em>, </td>
2052 <td class="md" nowrap>std::string </td>
2053 <td class="mdname" nowrap> <em>s</em></td>
2057 <td class="md">) </td>
2058 <td class="md" colspan="2"><code> [virtual]</code></td>
2065 <table cellspacing=5 cellpadding=0 border=0>
2073 Sends a line of text down a TCP/IP socket.
2075 This method writes a line of text to an established socket, cutting it to 510 characters plus a carriage return and linefeed if required.
2077 Definition at line <a class="el" href="modules_8cpp-source.html#l00431">431</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2079 <div class="fragment"><pre>00432 {
2080 00433 Write(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
2085 <a name="a8" doxytag="Server::SendChannel"></a><p>
2086 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2089 <table cellpadding="0" cellspacing="0" border="0">
2091 <td class="md" nowrap valign="top"> void Server::SendChannel </td>
2092 <td class="md" valign="top">( </td>
2093 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2094 <td class="mdname" nowrap> <em>User</em>, </td>
2099 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
2100 <td class="mdname" nowrap> <em>Channel</em>, </td>
2105 <td class="md" nowrap>std::string </td>
2106 <td class="mdname" nowrap> <em>s</em>, </td>
2111 <td class="md" nowrap>bool </td>
2112 <td class="mdname" nowrap> <em>IncludeSender</em></td>
2116 <td class="md">) </td>
2117 <td class="md" colspan="2"><code> [virtual]</code></td>
2124 <table cellspacing=5 cellpadding=0 border=0>
2132 Sends text from a user to a channel (mulicast).
2134 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).
2136 Definition at line <a class="el" href="modules_8cpp-source.html#l00460">460</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2138 <div class="fragment"><pre>00461 {
2139 00462 <span class="keywordflow">if</span> (IncludeSender)
2141 00464 WriteChannel(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
2143 00466 <span class="keywordflow">else</span>
2145 00468 ChanExceptSender(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
2151 <a name="a10" doxytag="Server::SendCommon"></a><p>
2152 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2155 <table cellpadding="0" cellspacing="0" border="0">
2157 <td class="md" nowrap valign="top"> void Server::SendCommon </td>
2158 <td class="md" valign="top">( </td>
2159 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2160 <td class="mdname" nowrap> <em>User</em>, </td>
2165 <td class="md" nowrap>std::string </td>
2166 <td class="mdname" nowrap> <em>text</em>, </td>
2171 <td class="md" nowrap>bool </td>
2172 <td class="mdname" nowrap> <em>IncludeSender</em></td>
2176 <td class="md">) </td>
2177 <td class="md" colspan="2"><code> [virtual]</code></td>
2184 <table cellspacing=5 cellpadding=0 border=0>
2192 Sends text from a user to one or more channels (mulicast).
2194 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.
2196 Definition at line <a class="el" href="modules_8cpp-source.html#l00477">477</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2198 <div class="fragment"><pre>00478 {
2199 00479 <span class="keywordflow">if</span> (IncludeSender)
2201 00481 WriteCommon(User,<span class="stringliteral">"%s"</span>,text.c_str());
2203 00483 <span class="keywordflow">else</span>
2205 00485 WriteCommonExcept(User,<span class="stringliteral">"%s"</span>,text.c_str());
2211 <a name="a6" doxytag="Server::SendFrom"></a><p>
2212 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2215 <table cellpadding="0" cellspacing="0" border="0">
2217 <td class="md" nowrap valign="top"> void Server::SendFrom </td>
2218 <td class="md" valign="top">( </td>
2219 <td class="md" nowrap valign="top">int </td>
2220 <td class="mdname" nowrap> <em>Socket</em>, </td>
2225 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2226 <td class="mdname" nowrap> <em>User</em>, </td>
2231 <td class="md" nowrap>std::string </td>
2232 <td class="mdname" nowrap> <em>s</em></td>
2236 <td class="md">) </td>
2237 <td class="md" colspan="2"><code> [virtual]</code></td>
2244 <table cellspacing=5 cellpadding=0 border=0>
2252 Sends text from a user to a socket.
2254 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)
2256 Definition at line <a class="el" href="modules_8cpp-source.html#l00441">441</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2258 <div class="fragment"><pre>00442 {
2259 00443 WriteFrom(Socket,User,<span class="stringliteral">"%s"</span>,s.c_str());
2264 <a name="a24" doxytag="Server::SendMode"></a><p>
2265 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2268 <table cellpadding="0" cellspacing="0" border="0">
2270 <td class="md" nowrap valign="top"> void Server::SendMode </td>
2271 <td class="md" valign="top">( </td>
2272 <td class="md" nowrap valign="top">char ** </td>
2273 <td class="mdname" nowrap> <em>parameters</em>, </td>
2278 <td class="md" nowrap>int </td>
2279 <td class="mdname" nowrap> <em>pcnt</em>, </td>
2284 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2285 <td class="mdname" nowrap> <em>user</em></td>
2289 <td class="md">) </td>
2290 <td class="md" colspan="2"><code> [virtual]</code></td>
2297 <table cellspacing=5 cellpadding=0 border=0>
2307 you must format the parameters array with the target, modes and parameters for those modes.<p>
2310 modes[0] = ChannelName;<p>
2312 modes[2] = user->nick;<p>
2313 Srv->SendMode(modes,3,user);<p>
2314 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!
2316 Definition at line <a class="el" href="modules_8cpp-source.html#l00426">426</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2318 References <a class="el" href="modules_8h.html#a36">server_mode()</a>.
2320 <div class="fragment"><pre>00427 {
2321 00428 <a class="code" href="modules_8h.html#a36">server_mode</a>(parameters,pcnt,user);
2326 <a name="a2" doxytag="Server::SendOpers"></a><p>
2327 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2330 <table cellpadding="0" cellspacing="0" border="0">
2332 <td class="md" nowrap valign="top"> void Server::SendOpers </td>
2333 <td class="md" valign="top">( </td>
2334 <td class="md" nowrap valign="top">std::string </td>
2335 <td class="mdname1" valign="top" nowrap> <em>s</em> </td>
2336 <td class="md" valign="top"> ) </td>
2337 <td class="md" nowrap><code> [virtual]</code></td>
2344 <table cellspacing=5 cellpadding=0 border=0>
2352 Sends text to all opers.
2354 This method sends a server notice to all opers with the usermode +s.
2356 Definition at line <a class="el" href="modules_8cpp-source.html#l00348">348</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2358 <div class="fragment"><pre>00349 {
2359 00350 WriteOpers(<span class="stringliteral">"%s"</span>,s.c_str());
2364 <a name="a5" doxytag="Server::SendServ"></a><p>
2365 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2368 <table cellpadding="0" cellspacing="0" border="0">
2370 <td class="md" nowrap valign="top"> void Server::SendServ </td>
2371 <td class="md" valign="top">( </td>
2372 <td class="md" nowrap valign="top">int </td>
2373 <td class="mdname" nowrap> <em>Socket</em>, </td>
2378 <td class="md" nowrap>std::string </td>
2379 <td class="mdname" nowrap> <em>s</em></td>
2383 <td class="md">) </td>
2384 <td class="md" colspan="2"><code> [virtual]</code></td>
2391 <table cellspacing=5 cellpadding=0 border=0>
2399 Sends text from the server to a socket.
2401 This method writes a line of text to an established socket, with the servername prepended as used by numerics (see RFC 1459)
2403 Definition at line <a class="el" href="modules_8cpp-source.html#l00436">436</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2405 <div class="fragment"><pre>00437 {
2406 00438 WriteServ(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
2411 <a name="a7" doxytag="Server::SendTo"></a><p>
2412 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2415 <table cellpadding="0" cellspacing="0" border="0">
2417 <td class="md" nowrap valign="top"> void Server::SendTo </td>
2418 <td class="md" valign="top">( </td>
2419 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2420 <td class="mdname" nowrap> <em>Source</em>, </td>
2425 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2426 <td class="mdname" nowrap> <em>Dest</em>, </td>
2431 <td class="md" nowrap>std::string </td>
2432 <td class="mdname" nowrap> <em>s</em></td>
2436 <td class="md">) </td>
2437 <td class="md" colspan="2"><code> [virtual]</code></td>
2444 <table cellspacing=5 cellpadding=0 border=0>
2452 Sends text from a user to another user.
2454 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>
2456 The format will become:<p>
2457 :localserver TEXT<p>
2458 Which is useful for numerics and server notices to single users, etc.
2460 Definition at line <a class="el" href="modules_8cpp-source.html#l00446">446</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2462 References <a class="el" href="connection_8h-source.html#l00178">connection::fd</a>.
2464 <div class="fragment"><pre>00447 {
2465 00448 <span class="keywordflow">if</span> (!Source)
2467 00450 <span class="comment">// if source is NULL, then the message originates from the local server</span>
2468 00451 Write(Dest-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">":%s %s"</span>,this->GetServerName().c_str(),s.c_str());
2470 00453 <span class="keywordflow">else</span>
2472 00455 <span class="comment">// otherwise it comes from the user specified</span>
2473 00456 WriteTo(Source,Dest,<span class="stringliteral">"%s"</span>,s.c_str());
2479 <a name="a25" doxytag="Server::SendToModeMask"></a><p>
2480 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2483 <table cellpadding="0" cellspacing="0" border="0">
2485 <td class="md" nowrap valign="top"> void Server::SendToModeMask </td>
2486 <td class="md" valign="top">( </td>
2487 <td class="md" nowrap valign="top">std::string </td>
2488 <td class="mdname" nowrap> <em>modes</em>, </td>
2493 <td class="md" nowrap>int </td>
2494 <td class="mdname" nowrap> <em>flags</em>, </td>
2499 <td class="md" nowrap>std::string </td>
2500 <td class="mdname" nowrap> <em>text</em></td>
2504 <td class="md">) </td>
2505 <td class="md" colspan="2"><code> [virtual]</code></td>
2512 <table cellspacing=5 cellpadding=0 border=0>
2520 Sends to all users matching a mode mask You must specify one or more usermodes as the first parameter.
2522 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>
2523 Serv->SendToModeMask("xi", WM_OR, "m00");<p>
2524 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.
2526 Definition at line <a class="el" href="modules_8cpp-source.html#l00361">361</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2528 <div class="fragment"><pre>00362 {
2529 00363 WriteMode(modes.c_str(),flags,<span class="stringliteral">"%s"</span>,text.c_str());
2534 <a name="a11" doxytag="Server::SendWallops"></a><p>
2535 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2538 <table cellpadding="0" cellspacing="0" border="0">
2540 <td class="md" nowrap valign="top"> void Server::SendWallops </td>
2541 <td class="md" valign="top">( </td>
2542 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2543 <td class="mdname" nowrap> <em>User</em>, </td>
2548 <td class="md" nowrap>std::string </td>
2549 <td class="mdname" nowrap> <em>text</em></td>
2553 <td class="md">) </td>
2554 <td class="md" colspan="2"><code> [virtual]</code></td>
2561 <table cellspacing=5 cellpadding=0 border=0>
2569 Sends a WALLOPS message.
2571 This method writes a WALLOPS message to all users with the +w flag, originating from the specified user.
2573 Definition at line <a class="el" href="modules_8cpp-source.html#l00489">489</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2575 <div class="fragment"><pre>00490 {
2576 00491 WriteWallOps(User,<span class="keyword">false</span>,<span class="stringliteral">"%s"</span>,text.c_str());
2581 <a name="a36" doxytag="Server::UserToPseudo"></a><p>
2582 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2585 <table cellpadding="0" cellspacing="0" border="0">
2587 <td class="md" nowrap valign="top"> bool Server::UserToPseudo </td>
2588 <td class="md" valign="top">( </td>
2589 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2590 <td class="mdname" nowrap> <em>user</em>, </td>
2595 <td class="md" nowrap>std::string </td>
2596 <td class="mdname" nowrap> <em>message</em></td>
2600 <td class="md">) </td>
2601 <td class="md" colspan="2"><code> [virtual]</code></td>
2608 <table cellspacing=5 cellpadding=0 border=0>
2616 Remove a user's connection to the irc server, but leave their client in existence in the user hash.
2618 When you call this function, the user's file descriptor will be replaced with the value of FD_MAGIC_NUMBER and their old file descriptor will be closed. This idle client will remain until it is restored with a valid file descriptor, or is removed from IRC by an operator After this call, the pointer to user will be invalid.
2620 Definition at line <a class="el" href="modules_8cpp-source.html#l00580">580</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2622 References <a class="el" href="connection_8h-source.html#l00178">connection::fd</a>, <a class="el" href="modules_8h-source.html#l00099">FD_MAGIC_NUMBER</a>, <a class="el" href="connection_8h-source.html#l00182">connection::host</a>, and <a class="el" href="users_8h-source.html#l00110">userrec::ident</a>.
2624 <div class="fragment"><pre>00581 {
2625 00582 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> old_fd = user-><a class="code" href="classconnection.html#o0">fd</a>;
2626 00583 user-><a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="modules_8h.html#a26">FD_MAGIC_NUMBER</a>;
2627 00584 Write(old_fd,<span class="stringliteral">"ERROR :Closing link (%s@%s) [%s]"</span>,user-><a class="code" href="classuserrec.html#o1">ident</a>,user-><a class="code" href="classconnection.html#o1">host</a>,message.c_str());
2628 00585 close(old_fd);
2629 00586 shutdown (old_fd,2);
2634 <hr>The documentation for this class was generated from the following files:<ul>
2635 <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>
2636 <hr size="1"><address style="align: right;"><small>Generated on Wed Apr 13 13:07:09 2005 for InspIRCd by
2637 <a href="http://www.doxygen.org/index.html">
2638 <img src="doxygen.png" alt="doxygen" align="middle" border=0 >
2639 </a>1.3.3 </small></address>