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>
165 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a49">IsValidMask</a> (std::string mask)</td></tr>
167 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns true if a nick!ident string is correctly formatted, false if otherwise. </em> <a href="#a49"></a><em><br><br></td></tr>
168 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a50">MeshSendAll</a> (std::string text)</td></tr>
170 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends a line of text to all connected servers. </em> <a href="#a50"></a><em><br><br></td></tr>
171 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a51">MeshSendCommon</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string text)</td></tr>
173 <tr><td class="mdescLeft"> </td><td class="mdescRight">This method sends a line of text to all servers who have users which share common channels with the user you provide. </em> <a href="#a51"></a><em><br><br></td></tr>
174 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a52">MeshSendAllAlive</a> (std::string text)</td></tr>
176 <tr><td class="mdescLeft"> </td><td class="mdescRight">This function is equivalent to Server::MeshSendToAll except it will only route to servers which are directly routable. </em> <a href="#a52"></a><em><br><br></td></tr>
177 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a53">MeshSendUnicast</a> (std::string destination, std::string text)</td></tr>
179 <tr><td class="mdescLeft"> </td><td class="mdescRight">This function sends a line of text directly to a server. </em> <a href="#a53"></a><em><br><br></td></tr>
180 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a54">MeshSendAllExcept</a> (std::string target, std::string text)</td></tr>
182 <tr><td class="mdescLeft"> </td><td class="mdescRight">This function sends to all servers EXCEPT the one you specify. </em> <a href="#a54"></a><em><br><br></td></tr>
183 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a55">MeshCheckChan</a> (<a class="el" href="classchanrec.html">chanrec</a> *c, std::string servername)</td></tr>
185 <tr><td class="mdescLeft"> </td><td class="mdescRight">This function is used to check if any users on channel c are on server servername. </em> <a href="#a55"></a><em><br><br></td></tr>
186 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classServer.html#a56">MeshCheckCommon</a> (<a class="el" href="classuserrec.html">userrec</a> *u, std::string servername)</td></tr>
188 <tr><td class="mdescLeft"> </td><td class="mdescRight">This function is used to check if user u has any channels in common with users on servername. </em> <a href="#a56"></a><em><br><br></td></tr>
190 <hr><a name="_details"></a><h2>Detailed Description</h2>
191 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.
193 All modules should instantiate at least one copy of this class, and use its member functions to perform their tasks.
197 Definition at line <a class="el" href="modules_8h-source.html#l00505">505</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor & Destructor Documentation</h2>
198 <a name="a0" doxytag="Server::Server"></a><p>
199 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
202 <table cellpadding="0" cellspacing="0" border="0">
204 <td class="md" nowrap valign="top"> Server::Server </td>
205 <td class="md" valign="top">( </td>
206 <td class="mdname1" valign="top" nowrap> </td>
207 <td class="md" valign="top"> ) </td>
208 <td class="md" nowrap></td>
215 <table cellspacing=5 cellpadding=0 border=0>
225 Creates a Server object.
227 Definition at line <a class="el" href="modules_8cpp-source.html#l00355">355</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
229 <div class="fragment"><pre>00356 {
234 <a name="a1" doxytag="Server::~Server"></a><p>
235 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
238 <table cellpadding="0" cellspacing="0" border="0">
240 <td class="md" nowrap valign="top"> Server::~<a class="el" href="classServer.html">Server</a> </td>
241 <td class="md" valign="top">( </td>
242 <td class="mdname1" valign="top" nowrap> </td>
243 <td class="md" valign="top"> ) </td>
244 <td class="md" nowrap><code> [virtual]</code></td>
251 <table cellspacing=5 cellpadding=0 border=0>
261 Destroys a Server object.
263 Definition at line <a class="el" href="modules_8cpp-source.html#l00359">359</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
265 <div class="fragment"><pre>00360 {
270 <hr><h2>Member Function Documentation</h2>
271 <a name="a23" doxytag="Server::AddCommand"></a><p>
272 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
275 <table cellpadding="0" cellspacing="0" border="0">
277 <td class="md" nowrap valign="top"> void Server::AddCommand </td>
278 <td class="md" valign="top">( </td>
279 <td class="md" nowrap valign="top">char * </td>
280 <td class="mdname" nowrap> <em>cmd</em>, </td>
285 <td class="md" nowrap>handlerfunc </td>
286 <td class="mdname" nowrap> <em>f</em>, </td>
291 <td class="md" nowrap>char </td>
292 <td class="mdname" nowrap> <em>flags</em>, </td>
297 <td class="md" nowrap>int </td>
298 <td class="mdname" nowrap> <em>minparams</em>, </td>
303 <td class="md" nowrap>char * </td>
304 <td class="mdname" nowrap> <em>source</em></td>
308 <td class="md">) </td>
309 <td class="md" colspan="2"><code> [virtual]</code></td>
316 <table cellspacing=5 cellpadding=0 border=0>
324 Adds a command to the command table.
326 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>
327 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>
328 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.
330 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>.
332 References <a class="el" href="modules_8h.html#a35">createcommand()</a>.
334 <div class="fragment"><pre>00437 {
335 00438 <a class="code" href="modules_8h.html#a35">createcommand</a>(cmd,f,flags,minparams,source);
340 <a name="a42" doxytag="Server::AddELine"></a><p>
341 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
344 <table cellpadding="0" cellspacing="0" border="0">
346 <td class="md" nowrap valign="top"> void Server::AddELine </td>
347 <td class="md" valign="top">( </td>
348 <td class="md" nowrap valign="top">long </td>
349 <td class="mdname" nowrap> <em>duration</em>, </td>
354 <td class="md" nowrap>std::string </td>
355 <td class="mdname" nowrap> <em>source</em>, </td>
360 <td class="md" nowrap>std::string </td>
361 <td class="mdname" nowrap> <em>reason</em>, </td>
366 <td class="md" nowrap>std::string </td>
367 <td class="mdname" nowrap> <em>hostmask</em></td>
371 <td class="md">) </td>
372 <td class="md" colspan="2"><code> [virtual]</code></td>
379 <table cellspacing=5 cellpadding=0 border=0>
387 Adds a E-line The E-line is enforced as soon as it is added.
389 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.
391 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>.
393 References <a class="el" href="xline_8h.html#a5">add_eline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
395 <div class="fragment"><pre>00655 {
396 00656 <a class="code" href="xline_8h.html#a5">add_eline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
401 <a name="a22" doxytag="Server::AddExtendedListMode"></a><p>
402 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
405 <table cellpadding="0" cellspacing="0" border="0">
407 <td class="md" nowrap valign="top"> bool Server::AddExtendedListMode </td>
408 <td class="md" valign="top">( </td>
409 <td class="md" nowrap valign="top">char </td>
410 <td class="mdname1" valign="top" nowrap> <em>modechar</em> </td>
411 <td class="md" valign="top"> ) </td>
412 <td class="md" nowrap><code> [virtual]</code></td>
419 <table cellspacing=5 cellpadding=0 border=0>
427 Adds an extended mode letter which is parsed by a module and handled in a list fashion.
429 This call is used to implement modes like +q and +a. The characteristics of these modes are as follows:<p>
430 (1) They are ALWAYS on channels, not on users, therefore their type is MT_CHANNEL<p>
431 (2) They always take exactly one parameter when being added or removed<p>
432 (3) They can be set multiple times, usually on users in channels<p>
433 (4) The mode and its parameter are NOT stored in the channels modes structure<p>
434 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.
436 Definition at line <a class="el" href="modules_8cpp-source.html#l00581">581</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
438 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>.
440 <div class="fragment"><pre>00582 {
441 00583 <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);
442 00584 <span class="keywordflow">if</span> (res)
443 00585 <a class="code" href="modules_8cpp.html#a58">ModeMakeList</a>(modechar);
444 00586 <span class="keywordflow">return</span> res;
449 <a name="a21" doxytag="Server::AddExtendedMode"></a><p>
450 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
453 <table cellpadding="0" cellspacing="0" border="0">
455 <td class="md" nowrap valign="top"> bool Server::AddExtendedMode </td>
456 <td class="md" valign="top">( </td>
457 <td class="md" nowrap valign="top">char </td>
458 <td class="mdname" nowrap> <em>modechar</em>, </td>
463 <td class="md" nowrap>int </td>
464 <td class="mdname" nowrap> <em>type</em>, </td>
469 <td class="md" nowrap>bool </td>
470 <td class="mdname" nowrap> <em>requires_oper</em>, </td>
475 <td class="md" nowrap>int </td>
476 <td class="mdname" nowrap> <em>params_when_on</em>, </td>
481 <td class="md" nowrap>int </td>
482 <td class="mdname" nowrap> <em>params_when_off</em></td>
486 <td class="md">) </td>
487 <td class="md" colspan="2"><code> [virtual]</code></td>
494 <table cellspacing=5 cellpadding=0 border=0>
502 Adds an extended mode letter which is parsed by a module.
504 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.
506 Definition at line <a class="el" href="modules_8cpp-source.html#l00561">561</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
508 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>.
510 <div class="fragment"><pre>00562 {
511 00563 <span class="keywordflow">if</span> (type == <a class="code" href="modules_8h.html#a7">MT_SERVER</a>)
513 00565 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion"</span>);
514 00566 <span class="keywordflow">return</span> <span class="keyword">false</span>;
516 00568 <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>))
518 00570 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Parameters on MT_CLIENT modes are not supported"</span>);
519 00571 <span class="keywordflow">return</span> <span class="keyword">false</span>;
521 00573 <span class="keywordflow">if</span> ((params_when_on>1) || (params_when_off>1))
523 00575 log(DEBUG,<span class="stringliteral">"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported"</span>);
524 00576 <span class="keywordflow">return</span> <span class="keyword">false</span>;
526 00578 <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);
531 <a name="a38" doxytag="Server::AddGLine"></a><p>
532 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
535 <table cellpadding="0" cellspacing="0" border="0">
537 <td class="md" nowrap valign="top"> void Server::AddGLine </td>
538 <td class="md" valign="top">( </td>
539 <td class="md" nowrap valign="top">long </td>
540 <td class="mdname" nowrap> <em>duration</em>, </td>
545 <td class="md" nowrap>std::string </td>
546 <td class="mdname" nowrap> <em>source</em>, </td>
551 <td class="md" nowrap>std::string </td>
552 <td class="mdname" nowrap> <em>reason</em>, </td>
557 <td class="md" nowrap>std::string </td>
558 <td class="mdname" nowrap> <em>hostmask</em></td>
562 <td class="md">) </td>
563 <td class="md" colspan="2"><code> [virtual]</code></td>
570 <table cellspacing=5 cellpadding=0 border=0>
578 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.
580 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.
582 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>.
584 References <a class="el" href="xline_8h.html#a1">add_gline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
586 <div class="fragment"><pre>00635 {
587 00636 <a class="code" href="xline_8h.html#a1">add_gline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
592 <a name="a41" doxytag="Server::AddKLine"></a><p>
593 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
596 <table cellpadding="0" cellspacing="0" border="0">
598 <td class="md" nowrap valign="top"> void Server::AddKLine </td>
599 <td class="md" valign="top">( </td>
600 <td class="md" nowrap valign="top">long </td>
601 <td class="mdname" nowrap> <em>duration</em>, </td>
606 <td class="md" nowrap>std::string </td>
607 <td class="mdname" nowrap> <em>source</em>, </td>
612 <td class="md" nowrap>std::string </td>
613 <td class="mdname" nowrap> <em>reason</em>, </td>
618 <td class="md" nowrap>std::string </td>
619 <td class="mdname" nowrap> <em>hostmask</em></td>
623 <td class="md">) </td>
624 <td class="md" colspan="2"><code> [virtual]</code></td>
631 <table cellspacing=5 cellpadding=0 border=0>
639 Adds a K-line The K-line is enforced as soon as it is added.
641 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.
643 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>.
645 References <a class="el" href="xline_8h.html#a4">add_kline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
647 <div class="fragment"><pre>00650 {
648 00651 <a class="code" href="xline_8h.html#a4">add_kline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
653 <a name="a39" doxytag="Server::AddQLine"></a><p>
654 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
657 <table cellpadding="0" cellspacing="0" border="0">
659 <td class="md" nowrap valign="top"> void Server::AddQLine </td>
660 <td class="md" valign="top">( </td>
661 <td class="md" nowrap valign="top">long </td>
662 <td class="mdname" nowrap> <em>duration</em>, </td>
667 <td class="md" nowrap>std::string </td>
668 <td class="mdname" nowrap> <em>source</em>, </td>
673 <td class="md" nowrap>std::string </td>
674 <td class="mdname" nowrap> <em>reason</em>, </td>
679 <td class="md" nowrap>std::string </td>
680 <td class="mdname" nowrap> <em>nickname</em></td>
684 <td class="md">) </td>
685 <td class="md" colspan="2"><code> [virtual]</code></td>
692 <table cellspacing=5 cellpadding=0 border=0>
700 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.
702 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.
704 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>.
706 References <a class="el" href="xline_8h.html#a2">add_qline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
708 <div class="fragment"><pre>00640 {
709 00641 <a class="code" href="xline_8h.html#a2">add_qline</a>(duration, source.c_str(), reason.c_str(), nickname.c_str());
714 <a name="a40" doxytag="Server::AddZLine"></a><p>
715 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
718 <table cellpadding="0" cellspacing="0" border="0">
720 <td class="md" nowrap valign="top"> void Server::AddZLine </td>
721 <td class="md" valign="top">( </td>
722 <td class="md" nowrap valign="top">long </td>
723 <td class="mdname" nowrap> <em>duration</em>, </td>
728 <td class="md" nowrap>std::string </td>
729 <td class="mdname" nowrap> <em>source</em>, </td>
734 <td class="md" nowrap>std::string </td>
735 <td class="mdname" nowrap> <em>reason</em>, </td>
740 <td class="md" nowrap>std::string </td>
741 <td class="mdname" nowrap> <em>ipaddr</em></td>
745 <td class="md">) </td>
746 <td class="md" colspan="2"><code> [virtual]</code></td>
753 <table cellspacing=5 cellpadding=0 border=0>
761 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.
763 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.
765 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>.
767 References <a class="el" href="xline_8h.html#a3">add_zline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
769 <div class="fragment"><pre>00645 {
770 00646 <a class="code" href="xline_8h.html#a3">add_zline</a>(duration, source.c_str(), reason.c_str(), ipaddr.c_str());
775 <a name="a48" doxytag="Server::CalcDuration"></a><p>
776 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
779 <table cellpadding="0" cellspacing="0" border="0">
781 <td class="md" nowrap valign="top"> long Server::CalcDuration </td>
782 <td class="md" valign="top">( </td>
783 <td class="md" nowrap valign="top">std::string </td>
784 <td class="mdname1" valign="top" nowrap> <em>duration</em> </td>
785 <td class="md" valign="top"> ) </td>
786 <td class="md" nowrap><code> [virtual]</code></td>
793 <table cellspacing=5 cellpadding=0 border=0>
801 Calculates a duration This method will take a string containing a formatted duration (e.g.
803 "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.
805 Definition at line <a class="el" href="modules_8cpp-source.html#l00684">684</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
807 References <a class="el" href="commands_8h.html#a75">duration()</a>.
809 <div class="fragment"><pre>00685 {
810 00686 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a75">duration</a>(delta.c_str());
815 <a name="a31" doxytag="Server::CallCommandHandler"></a><p>
816 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
819 <table cellpadding="0" cellspacing="0" border="0">
821 <td class="md" nowrap valign="top"> void Server::CallCommandHandler </td>
822 <td class="md" valign="top">( </td>
823 <td class="md" nowrap valign="top">std::string </td>
824 <td class="mdname" nowrap> <em>commandname</em>, </td>
829 <td class="md" nowrap>char ** </td>
830 <td class="mdname" nowrap> <em>parameters</em>, </td>
835 <td class="md" nowrap>int </td>
836 <td class="mdname" nowrap> <em>pcnt</em>, </td>
841 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
842 <td class="mdname" nowrap> <em>user</em></td>
846 <td class="md">) </td>
847 <td class="md" colspan="2"><code> [virtual]</code></td>
854 <table cellspacing=5 cellpadding=0 border=0>
862 Calls the handler for a command, either implemented by the core or by another module.
864 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>
865 ) 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.
867 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>.
869 <div class="fragment"><pre>00427 {
870 00428 call_handler(commandname.c_str(),parameters,pcnt,user);
875 <a name="a33" doxytag="Server::ChangeGECOS"></a><p>
876 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
879 <table cellpadding="0" cellspacing="0" border="0">
881 <td class="md" nowrap valign="top"> void Server::ChangeGECOS </td>
882 <td class="md" valign="top">( </td>
883 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
884 <td class="mdname" nowrap> <em>user</em>, </td>
889 <td class="md" nowrap>std::string </td>
890 <td class="mdname" nowrap> <em>gecos</em></td>
894 <td class="md">) </td>
895 <td class="md" colspan="2"><code> [virtual]</code></td>
902 <table cellspacing=5 cellpadding=0 border=0>
910 Change GECOS (fullname) of a user.
912 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.
914 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>.
916 References <a class="el" href="message_8h.html#a10">ChangeName()</a>.
918 <div class="fragment"><pre>00515 {
919 00516 <a class="code" href="message_8h.html#a10">ChangeName</a>(user,gecos.c_str());
924 <a name="a32" doxytag="Server::ChangeHost"></a><p>
925 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
928 <table cellpadding="0" cellspacing="0" border="0">
930 <td class="md" nowrap valign="top"> void Server::ChangeHost </td>
931 <td class="md" valign="top">( </td>
932 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
933 <td class="mdname" nowrap> <em>user</em>, </td>
938 <td class="md" nowrap>std::string </td>
939 <td class="mdname" nowrap> <em>host</em></td>
943 <td class="md">) </td>
944 <td class="md" colspan="2"><code> [virtual]</code></td>
951 <table cellspacing=5 cellpadding=0 border=0>
959 Change displayed hostname of a user.
961 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.
963 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>.
965 References <a class="el" href="message_8h.html#a11">ChangeDisplayedHost()</a>.
967 <div class="fragment"><pre>00510 {
968 00511 <a class="code" href="message_8h.html#a11">ChangeDisplayedHost</a>(user,host.c_str());
973 <a name="a28" doxytag="Server::ChangeUserNick"></a><p>
974 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
977 <table cellpadding="0" cellspacing="0" border="0">
979 <td class="md" nowrap valign="top"> void Server::ChangeUserNick </td>
980 <td class="md" valign="top">( </td>
981 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
982 <td class="mdname" nowrap> <em>user</em>, </td>
987 <td class="md" nowrap>std::string </td>
988 <td class="mdname" nowrap> <em>nickname</em></td>
992 <td class="md">) </td>
993 <td class="md" colspan="2"><code> [virtual]</code></td>
1000 <table cellspacing=5 cellpadding=0 border=0>
1008 Forces a user nickchange.
1010 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.
1012 Definition at line <a class="el" href="modules_8cpp-source.html#l00410">410</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1014 <div class="fragment"><pre>00411 {
1015 00412 force_nickchange(user,nickname.c_str());
1020 <a name="a16" doxytag="Server::ChanMode"></a><p>
1021 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1024 <table cellpadding="0" cellspacing="0" border="0">
1026 <td class="md" nowrap valign="top"> std::string Server::ChanMode </td>
1027 <td class="md" valign="top">( </td>
1028 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1029 <td class="mdname" nowrap> <em>User</em>, </td>
1034 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
1035 <td class="mdname" nowrap> <em>Chan</em></td>
1039 <td class="md">) </td>
1040 <td class="md" colspan="2"><code> [virtual]</code></td>
1047 <table cellspacing=5 cellpadding=0 border=0>
1055 Attempts to look up a user's privilages on a channel.
1057 This function will return a string containing either @, , +, or an empty string, representing the user's privilages upon the channel you specify.
1059 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>.
1061 References <a class="el" href="message_8h.html#a14">cmode()</a>.
1063 <div class="fragment"><pre>00535 {
1064 00536 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a14">cmode</a>(User,Chan);
1069 <a name="a9" doxytag="Server::CommonChannels"></a><p>
1070 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1073 <table cellpadding="0" cellspacing="0" border="0">
1075 <td class="md" nowrap valign="top"> bool Server::CommonChannels </td>
1076 <td class="md" valign="top">( </td>
1077 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1078 <td class="mdname" nowrap> <em>u1</em>, </td>
1083 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
1084 <td class="mdname" nowrap> <em>u2</em></td>
1088 <td class="md">) </td>
1089 <td class="md" colspan="2"><code> [virtual]</code></td>
1096 <table cellspacing=5 cellpadding=0 border=0>
1104 Returns true if two users share a common channel.
1106 This method is used internally by the NICK and QUIT commands, and the <a class="el" href="classServer.html#a10">Server::SendCommon</a> method.
1108 Definition at line <a class="el" href="modules_8cpp-source.html#l00487">487</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1110 References <a class="el" href="message_8h.html#a0">common_channels()</a>.
1112 <div class="fragment"><pre>00488 {
1113 00489 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a0">common_channels</a>(u1,u2) != 0);
1118 <a name="a13" doxytag="Server::CountUsers"></a><p>
1119 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1122 <table cellpadding="0" cellspacing="0" border="0">
1124 <td class="md" nowrap valign="top"> int Server::CountUsers </td>
1125 <td class="md" valign="top">( </td>
1126 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
1127 <td class="mdname1" valign="top" nowrap> <em>c</em> </td>
1128 <td class="md" valign="top"> ) </td>
1129 <td class="md" nowrap><code> [virtual]</code></td>
1136 <table cellspacing=5 cellpadding=0 border=0>
1144 Returns a count of the number of users on a channel.
1146 This will NEVER be 0, as if the chanrec exists, it will have at least one user in the channel.
1148 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>.
1150 <div class="fragment"><pre>00590 {
1151 00591 <span class="keywordflow">return</span> usercount(c);
1156 <a name="a47" doxytag="Server::DelELine"></a><p>
1157 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1160 <table cellpadding="0" cellspacing="0" border="0">
1162 <td class="md" nowrap valign="top"> bool Server::DelELine </td>
1163 <td class="md" valign="top">( </td>
1164 <td class="md" nowrap valign="top">std::string </td>
1165 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1166 <td class="md" valign="top"> ) </td>
1167 <td class="md" nowrap><code> [virtual]</code></td>
1174 <table cellspacing=5 cellpadding=0 border=0>
1182 Deletes a local E-Line.
1186 Definition at line <a class="el" href="modules_8cpp-source.html#l00679">679</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1188 References <a class="el" href="xline_8h.html#a10">del_eline()</a>.
1190 <div class="fragment"><pre>00680 {
1191 00681 <a class="code" href="xline_8h.html#a10">del_eline</a>(hostmask.c_str());
1196 <a name="a43" doxytag="Server::DelGLine"></a><p>
1197 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1200 <table cellpadding="0" cellspacing="0" border="0">
1202 <td class="md" nowrap valign="top"> bool Server::DelGLine </td>
1203 <td class="md" valign="top">( </td>
1204 <td class="md" nowrap valign="top">std::string </td>
1205 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1206 <td class="md" valign="top"> ) </td>
1207 <td class="md" nowrap><code> [virtual]</code></td>
1214 <table cellspacing=5 cellpadding=0 border=0>
1222 Deletes a G-Line from all servers on the mesh.
1226 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>.
1228 References <a class="el" href="xline_8h.html#a6">del_gline()</a>.
1230 <div class="fragment"><pre>00660 {
1231 00661 <a class="code" href="xline_8h.html#a6">del_gline</a>(hostmask.c_str());
1236 <a name="a46" doxytag="Server::DelKLine"></a><p>
1237 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1240 <table cellpadding="0" cellspacing="0" border="0">
1242 <td class="md" nowrap valign="top"> bool Server::DelKLine </td>
1243 <td class="md" valign="top">( </td>
1244 <td class="md" nowrap valign="top">std::string </td>
1245 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1246 <td class="md" valign="top"> ) </td>
1247 <td class="md" nowrap><code> [virtual]</code></td>
1254 <table cellspacing=5 cellpadding=0 border=0>
1262 Deletes a local K-Line.
1266 Definition at line <a class="el" href="modules_8cpp-source.html#l00674">674</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1268 References <a class="el" href="xline_8h.html#a9">del_kline()</a>.
1270 <div class="fragment"><pre>00675 {
1271 00676 <a class="code" href="xline_8h.html#a9">del_kline</a>(hostmask.c_str());
1276 <a name="a44" doxytag="Server::DelQLine"></a><p>
1277 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1280 <table cellpadding="0" cellspacing="0" border="0">
1282 <td class="md" nowrap valign="top"> bool Server::DelQLine </td>
1283 <td class="md" valign="top">( </td>
1284 <td class="md" nowrap valign="top">std::string </td>
1285 <td class="mdname1" valign="top" nowrap> <em>nickname</em> </td>
1286 <td class="md" valign="top"> ) </td>
1287 <td class="md" nowrap><code> [virtual]</code></td>
1294 <table cellspacing=5 cellpadding=0 border=0>
1302 Deletes a Q-Line from all servers on the mesh.
1306 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>.
1308 References <a class="el" href="xline_8h.html#a7">del_qline()</a>.
1310 <div class="fragment"><pre>00665 {
1311 00666 <a class="code" href="xline_8h.html#a7">del_qline</a>(nickname.c_str());
1316 <a name="a45" doxytag="Server::DelZLine"></a><p>
1317 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1320 <table cellpadding="0" cellspacing="0" border="0">
1322 <td class="md" nowrap valign="top"> bool Server::DelZLine </td>
1323 <td class="md" valign="top">( </td>
1324 <td class="md" nowrap valign="top">std::string </td>
1325 <td class="mdname1" valign="top" nowrap> <em>ipaddr</em> </td>
1326 <td class="md" valign="top"> ) </td>
1327 <td class="md" nowrap><code> [virtual]</code></td>
1334 <table cellspacing=5 cellpadding=0 border=0>
1342 Deletes a Z-Line from all servers on the mesh.
1346 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>.
1348 References <a class="el" href="xline_8h.html#a8">del_zline()</a>.
1350 <div class="fragment"><pre>00670 {
1351 00671 <a class="code" href="xline_8h.html#a8">del_zline</a>(ipaddr.c_str());
1356 <a name="a15" doxytag="Server::FindChannel"></a><p>
1357 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1360 <table cellpadding="0" cellspacing="0" border="0">
1362 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::FindChannel </td>
1363 <td class="md" valign="top">( </td>
1364 <td class="md" nowrap valign="top">std::string </td>
1365 <td class="mdname1" valign="top" nowrap> <em>channel</em> </td>
1366 <td class="md" valign="top"> ) </td>
1367 <td class="md" nowrap><code> [virtual]</code></td>
1374 <table cellspacing=5 cellpadding=0 border=0>
1382 Attempts to look up a channel and return a pointer to it.
1384 This function will return NULL if the channel does not exist.
1386 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>.
1388 <div class="fragment"><pre>00530 {
1389 00531 <span class="keywordflow">return</span> FindChan(channel.c_str());
1394 <a name="a14" doxytag="Server::FindNick"></a><p>
1395 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1398 <table cellpadding="0" cellspacing="0" border="0">
1400 <td class="md" nowrap valign="top"> <a class="el" href="classuserrec.html">userrec</a> * Server::FindNick </td>
1401 <td class="md" valign="top">( </td>
1402 <td class="md" nowrap valign="top">std::string </td>
1403 <td class="mdname1" valign="top" nowrap> <em>nick</em> </td>
1404 <td class="md" valign="top"> ) </td>
1405 <td class="md" nowrap><code> [virtual]</code></td>
1412 <table cellspacing=5 cellpadding=0 border=0>
1420 Attempts to look up a nick and return a pointer to it.
1422 This function will return NULL if the nick does not exist.
1424 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>.
1426 <div class="fragment"><pre>00525 {
1427 00526 <span class="keywordflow">return</span> Find(nick);
1432 <a name="a20" doxytag="Server::GetAdmin"></a><p>
1433 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1436 <table cellpadding="0" cellspacing="0" border="0">
1438 <td class="md" nowrap valign="top"> <a class="el" href="classAdmin.html">Admin</a> Server::GetAdmin </td>
1439 <td class="md" valign="top">( </td>
1440 <td class="mdname1" valign="top" nowrap> </td>
1441 <td class="md" valign="top"> ) </td>
1442 <td class="md" nowrap><code> [virtual]</code></td>
1449 <table cellspacing=5 cellpadding=0 border=0>
1457 Returns the information of the server as returned by the /ADMIN command.
1459 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.
1461 Definition at line <a class="el" href="modules_8cpp-source.html#l00554">554</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1463 <div class="fragment"><pre>00555 {
1464 00556 <span class="keywordflow">return</span> <a class="code" href="classAdmin.html">Admin</a>(getadminname(),getadminemail(),getadminnick());
1469 <a name="a19" doxytag="Server::GetNetworkName"></a><p>
1470 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1473 <table cellpadding="0" cellspacing="0" border="0">
1475 <td class="md" nowrap valign="top"> std::string Server::GetNetworkName </td>
1476 <td class="md" valign="top">( </td>
1477 <td class="mdname1" valign="top" nowrap> </td>
1478 <td class="md" valign="top"> ) </td>
1479 <td class="md" nowrap><code> [virtual]</code></td>
1486 <table cellspacing=5 cellpadding=0 border=0>
1494 Returns the network name, global to all linked servers.
1498 Definition at line <a class="el" href="modules_8cpp-source.html#l00549">549</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1500 <div class="fragment"><pre>00550 {
1501 00551 <span class="keywordflow">return</span> getnetworkname();
1506 <a name="a18" doxytag="Server::GetServerName"></a><p>
1507 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1510 <table cellpadding="0" cellspacing="0" border="0">
1512 <td class="md" nowrap valign="top"> std::string Server::GetServerName </td>
1513 <td class="md" valign="top">( </td>
1514 <td class="mdname1" valign="top" nowrap> </td>
1515 <td class="md" valign="top"> ) </td>
1516 <td class="md" nowrap><code> [virtual]</code></td>
1523 <table cellspacing=5 cellpadding=0 border=0>
1531 Returns the server name of the server where the module is loaded.
1535 Definition at line <a class="el" href="modules_8cpp-source.html#l00544">544</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1537 <div class="fragment"><pre>00545 {
1538 00546 <span class="keywordflow">return</span> getservername();
1543 <a name="a35" doxytag="Server::GetUsers"></a><p>
1544 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1547 <table cellpadding="0" cellspacing="0" border="0">
1549 <td class="md" nowrap valign="top"> <a class="el" href="modules_8h.html#a33">chanuserlist</a> Server::GetUsers </td>
1550 <td class="md" valign="top">( </td>
1551 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
1552 <td class="mdname1" valign="top" nowrap> <em>chan</em> </td>
1553 <td class="md" valign="top"> ) </td>
1554 <td class="md" nowrap><code> [virtual]</code></td>
1561 <table cellspacing=5 cellpadding=0 border=0>
1569 Fetches the userlist of a channel.
1571 This function must be here and not a member of userrec or chanrec due to include constraints.
1573 Definition at line <a class="el" href="modules_8cpp-source.html#l00391">391</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1575 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>.
1577 <div class="fragment"><pre>00392 {
1578 00393 <a class="code" href="modules_8h.html#a33">chanuserlist</a> userl;
1579 00394 userl.clear();
1580 00395 <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++)
1582 00397 <span class="keywordflow">if</span> (i->second)
1584 00399 <span class="keywordflow">if</span> (<a class="code" href="message_8h.html#a16">has_channel</a>(i->second,chan))
1586 00401 <span class="keywordflow">if</span> (<a class="code" href="message_8h.html#a13">isnick</a>(i->second->nick))
1588 00403 userl.push_back(i->second);
1593 00408 <span class="keywordflow">return</span> userl;
1598 <a name="a12" doxytag="Server::IsNick"></a><p>
1599 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1602 <table cellpadding="0" cellspacing="0" border="0">
1604 <td class="md" nowrap valign="top"> bool Server::IsNick </td>
1605 <td class="md" valign="top">( </td>
1606 <td class="md" nowrap valign="top">std::string </td>
1607 <td class="mdname1" valign="top" nowrap> <em>nick</em> </td>
1608 <td class="md" valign="top"> ) </td>
1609 <td class="md" nowrap><code> [virtual]</code></td>
1616 <table cellspacing=5 cellpadding=0 border=0>
1624 Returns true if a nick is valid.
1626 Nicks for unregistered connections will return false.
1628 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>.
1630 References <a class="el" href="message_8h.html#a13">isnick()</a>.
1632 <div class="fragment"><pre>00520 {
1633 00521 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a13">isnick</a>(nick.c_str()) != 0);
1638 <a name="a17" doxytag="Server::IsOnChannel"></a><p>
1639 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1642 <table cellpadding="0" cellspacing="0" border="0">
1644 <td class="md" nowrap valign="top"> bool Server::IsOnChannel </td>
1645 <td class="md" valign="top">( </td>
1646 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1647 <td class="mdname" nowrap> <em>User</em>, </td>
1652 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
1653 <td class="mdname" nowrap> <em>Chan</em></td>
1657 <td class="md">) </td>
1658 <td class="md" colspan="2"><code> [virtual]</code></td>
1665 <table cellspacing=5 cellpadding=0 border=0>
1673 Checks if a user is on a channel.
1675 This function will return true or false to indicate if user 'User' is on channel 'Chan'.
1677 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>.
1679 References <a class="el" href="message_8h.html#a16">has_channel()</a>.
1681 <div class="fragment"><pre>00540 {
1682 00541 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a16">has_channel</a>(User,Chan);
1687 <a name="a34" doxytag="Server::IsUlined"></a><p>
1688 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1691 <table cellpadding="0" cellspacing="0" border="0">
1693 <td class="md" nowrap valign="top"> bool Server::IsUlined </td>
1694 <td class="md" valign="top">( </td>
1695 <td class="md" nowrap valign="top">std::string </td>
1696 <td class="mdname1" valign="top" nowrap> <em>server</em> </td>
1697 <td class="md" valign="top"> ) </td>
1698 <td class="md" nowrap><code> [virtual]</code></td>
1705 <table cellspacing=5 cellpadding=0 border=0>
1713 Returns true if the servername you give is ulined.
1715 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.
1717 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>.
1719 References <a class="el" href="commands_8h.html#a74">is_uline()</a>.
1721 <div class="fragment"><pre>00422 {
1722 00423 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a74">is_uline</a>(server.c_str());
1727 <a name="a49" doxytag="Server::IsValidMask"></a><p>
1728 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1731 <table cellpadding="0" cellspacing="0" border="0">
1733 <td class="md" nowrap valign="top"> bool Server::IsValidMask </td>
1734 <td class="md" valign="top">( </td>
1735 <td class="md" nowrap valign="top">std::string </td>
1736 <td class="mdname1" valign="top" nowrap> <em>mask</em> </td>
1737 <td class="md" valign="top"> ) </td>
1738 <td class="md" nowrap><code> [virtual]</code></td>
1745 <table cellspacing=5 cellpadding=0 border=0>
1753 Returns true if a nick!ident string is correctly formatted, false if otherwise.
1757 Definition at line <a class="el" href="modules_8cpp-source.html#l00689">689</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1759 <div class="fragment"><pre>00690 {
1760 00691 <span class="keyword">const</span> <span class="keywordtype">char</span>* dest = mask.c_str();
1761 00692 <span class="keywordflow">if</span> (strchr(dest,<span class="charliteral">'!'</span>)==0)
1762 00693 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1763 00694 <span class="keywordflow">if</span> (strchr(dest,<span class="charliteral">'@'</span>)==0)
1764 00695 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1765 00696 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1766 00697 <span class="keywordflow">if</span> (dest[i] < 32)
1767 00698 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1768 00699 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1769 00700 <span class="keywordflow">if</span> (dest[i] > 126)
1770 00701 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1771 00702 <span class="keywordtype">int</span> c = 0;
1772 00703 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1773 00704 <span class="keywordflow">if</span> (dest[i] == <span class="charliteral">'!'</span>)
1775 00706 <span class="keywordflow">if</span> (c>1)
1776 00707 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1778 00709 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1779 00710 <span class="keywordflow">if</span> (dest[i] == <span class="charliteral">'@'</span>)
1781 00712 <span class="keywordflow">if</span> (c>1)
1782 00713 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1784 00715 <span class="keywordflow">return</span> <span class="keyword">true</span>;
1789 <a name="a26" doxytag="Server::JoinUserToChannel"></a><p>
1790 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1793 <table cellpadding="0" cellspacing="0" border="0">
1795 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::JoinUserToChannel </td>
1796 <td class="md" valign="top">( </td>
1797 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1798 <td class="mdname" nowrap> <em>user</em>, </td>
1803 <td class="md" nowrap>std::string </td>
1804 <td class="mdname" nowrap> <em>cname</em>, </td>
1809 <td class="md" nowrap>std::string </td>
1810 <td class="mdname" nowrap> <em>key</em></td>
1814 <td class="md">) </td>
1815 <td class="md" colspan="2"><code> [virtual]</code></td>
1822 <table cellspacing=5 cellpadding=0 border=0>
1830 Forces a user to join a channel.
1832 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.
1834 Definition at line <a class="el" href="modules_8cpp-source.html#l00381">381</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1836 <div class="fragment"><pre>00382 {
1837 00383 <span class="keywordflow">return</span> add_channel(user,cname.c_str(),key.c_str(),<span class="keyword">true</span>);
1842 <a name="a3" doxytag="Server::Log"></a><p>
1843 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1846 <table cellpadding="0" cellspacing="0" border="0">
1848 <td class="md" nowrap valign="top"> void Server::Log </td>
1849 <td class="md" valign="top">( </td>
1850 <td class="md" nowrap valign="top">int </td>
1851 <td class="mdname" nowrap> <em>level</em>, </td>
1856 <td class="md" nowrap>std::string </td>
1857 <td class="mdname" nowrap> <em>s</em></td>
1861 <td class="md">) </td>
1862 <td class="md" colspan="2"><code> [virtual]</code></td>
1869 <table cellspacing=5 cellpadding=0 border=0>
1877 Writes a log string.
1879 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.
1881 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>.
1883 <div class="fragment"><pre>00432 {
1884 00433 log(level,<span class="stringliteral">"%s"</span>,s.c_str());
1889 <a name="a30" doxytag="Server::MatchText"></a><p>
1890 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1893 <table cellpadding="0" cellspacing="0" border="0">
1895 <td class="md" nowrap valign="top"> bool Server::MatchText </td>
1896 <td class="md" valign="top">( </td>
1897 <td class="md" nowrap valign="top">std::string </td>
1898 <td class="mdname" nowrap> <em>sliteral</em>, </td>
1903 <td class="md" nowrap>std::string </td>
1904 <td class="mdname" nowrap> <em>spattern</em></td>
1908 <td class="md">) </td>
1909 <td class="md" colspan="2"><code> [virtual]</code></td>
1916 <table cellspacing=5 cellpadding=0 border=0>
1924 Matches text against a glob pattern.
1926 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.
1928 Definition at line <a class="el" href="modules_8cpp-source.html#l00368">368</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1930 <div class="fragment"><pre>00369 {
1931 00370 <span class="keywordtype">char</span> literal[MAXBUF],pattern[MAXBUF];
1932 00371 strlcpy(literal,sliteral.c_str(),MAXBUF);
1933 00372 strlcpy(pattern,spattern.c_str(),MAXBUF);
1934 00373 <span class="keywordflow">return</span> match(literal,pattern);
1939 <a name="a55" doxytag="Server::MeshCheckChan"></a><p>
1940 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1943 <table cellpadding="0" cellspacing="0" border="0">
1945 <td class="md" nowrap valign="top"> bool Server::MeshCheckChan </td>
1946 <td class="md" valign="top">( </td>
1947 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
1948 <td class="mdname" nowrap> <em>c</em>, </td>
1953 <td class="md" nowrap>std::string </td>
1954 <td class="mdname" nowrap> <em>servername</em></td>
1958 <td class="md">) </td>
1959 <td class="md" colspan="2"><code> [virtual]</code></td>
1966 <table cellspacing=5 cellpadding=0 border=0>
1974 This function is used to check if any users on channel c are on server servername.
1976 This is used internally by PRIVMSG etc. You should not need to use it.
1978 Definition at line <a class="el" href="modules_8cpp-source.html#l00744">744</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1980 <div class="fragment"><pre>00745 {
1981 00746 <span class="keywordflow">if</span> (c)
1983 00748 <span class="keywordflow">return</span> ChanAnyOnThisServer(c,(<span class="keywordtype">char</span>*)servername.c_str());
1985 00750 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;
1990 <a name="a56" doxytag="Server::MeshCheckCommon"></a><p>
1991 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1994 <table cellpadding="0" cellspacing="0" border="0">
1996 <td class="md" nowrap valign="top"> bool Server::MeshCheckCommon </td>
1997 <td class="md" valign="top">( </td>
1998 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1999 <td class="mdname" nowrap> <em>u</em>, </td>
2004 <td class="md" nowrap>std::string </td>
2005 <td class="mdname" nowrap> <em>servername</em></td>
2009 <td class="md">) </td>
2010 <td class="md" colspan="2"><code> [virtual]</code></td>
2017 <table cellspacing=5 cellpadding=0 border=0>
2025 This function is used to check if user u has any channels in common with users on servername.
2027 This is used internally by <a class="el" href="classServer.html#a51">Server::MeshSendCommon</a>. You should very rarely need to use it.
2029 Definition at line <a class="el" href="modules_8cpp-source.html#l00753">753</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2031 <div class="fragment"><pre>00754 {
2032 00755 <span class="keywordflow">if</span> (u)
2034 00757 <span class="keywordflow">return</span> CommonOnThisServer(u,(<span class="keywordtype">char</span>*)servername.c_str());
2036 00759 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;
2041 <a name="a50" doxytag="Server::MeshSendAll"></a><p>
2042 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2045 <table cellpadding="0" cellspacing="0" border="0">
2047 <td class="md" nowrap valign="top"> void Server::MeshSendAll </td>
2048 <td class="md" valign="top">( </td>
2049 <td class="md" nowrap valign="top">std::string </td>
2050 <td class="mdname1" valign="top" nowrap> <em>text</em> </td>
2051 <td class="md" valign="top"> ) </td>
2052 <td class="md" nowrap><code> [virtual]</code></td>
2059 <table cellspacing=5 cellpadding=0 border=0>
2067 Sends a line of text to all connected servers.
2069 If a server is not directly reachable, the core deals with routing the message, and will also deal with failures transparently.
2071 Definition at line <a class="el" href="modules_8cpp-source.html#l00718">718</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2073 <div class="fragment"><pre>00719 {
2074 00720 NetSendToAll((<span class="keywordtype">char</span>*)text.c_str());
2079 <a name="a52" doxytag="Server::MeshSendAllAlive"></a><p>
2080 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2083 <table cellpadding="0" cellspacing="0" border="0">
2085 <td class="md" nowrap valign="top"> void Server::MeshSendAllAlive </td>
2086 <td class="md" valign="top">( </td>
2087 <td class="md" nowrap valign="top">std::string </td>
2088 <td class="mdname1" valign="top" nowrap> <em>text</em> </td>
2089 <td class="md" valign="top"> ) </td>
2090 <td class="md" nowrap><code> [virtual]</code></td>
2097 <table cellspacing=5 cellpadding=0 border=0>
2105 This function is equivalent to Server::MeshSendToAll except it will only route to servers which are directly routable.
2109 Definition at line <a class="el" href="modules_8cpp-source.html#l00729">729</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2111 <div class="fragment"><pre>00730 {
2112 00731 NetSendToAllAlive((<span class="keywordtype">char</span>*)text.c_str());
2117 <a name="a54" doxytag="Server::MeshSendAllExcept"></a><p>
2118 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2121 <table cellpadding="0" cellspacing="0" border="0">
2123 <td class="md" nowrap valign="top"> void Server::MeshSendAllExcept </td>
2124 <td class="md" valign="top">( </td>
2125 <td class="md" nowrap valign="top">std::string </td>
2126 <td class="mdname" nowrap> <em>target</em>, </td>
2131 <td class="md" nowrap>std::string </td>
2132 <td class="mdname" nowrap> <em>text</em></td>
2136 <td class="md">) </td>
2137 <td class="md" colspan="2"><code> [virtual]</code></td>
2144 <table cellspacing=5 cellpadding=0 border=0>
2152 This function sends to all servers EXCEPT the one you specify.
2154 You should usually use this function to send messages, specifying the SENDER of your message as 'target'. This will prevent message loops.
2156 Definition at line <a class="el" href="modules_8cpp-source.html#l00739">739</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2158 <div class="fragment"><pre>00740 {
2159 00741 NetSendToAllExcept(target.c_str(),(<span class="keywordtype">char</span>*)text.c_str());
2164 <a name="a51" doxytag="Server::MeshSendCommon"></a><p>
2165 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2168 <table cellpadding="0" cellspacing="0" border="0">
2170 <td class="md" nowrap valign="top"> void Server::MeshSendCommon </td>
2171 <td class="md" valign="top">( </td>
2172 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2173 <td class="mdname" nowrap> <em>user</em>, </td>
2178 <td class="md" nowrap>std::string </td>
2179 <td class="mdname" nowrap> <em>text</em></td>
2183 <td class="md">) </td>
2184 <td class="md" colspan="2"><code> [virtual]</code></td>
2191 <table cellspacing=5 cellpadding=0 border=0>
2199 This method sends a line of text to all servers who have users which share common channels with the user you provide.
2201 For example, if user A is on server A, and they are on channels #one and #two, and user B is on server B, and also on channel #one, but user C is on server C and on neither #one or #two, this function will cause the text to only be sent to server B. However, if server B is only reachable via C, it will route it to C (you do not have to worry about this routing, it is done transparently, but its good to know how things work!)
2203 Definition at line <a class="el" href="modules_8cpp-source.html#l00723">723</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2205 <div class="fragment"><pre>00724 {
2206 00725 <span class="keywordflow">if</span> (user)
2207 00726 NetSendToCommon(user,(<span class="keywordtype">char</span>*)text.c_str());
2212 <a name="a53" doxytag="Server::MeshSendUnicast"></a><p>
2213 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2216 <table cellpadding="0" cellspacing="0" border="0">
2218 <td class="md" nowrap valign="top"> void Server::MeshSendUnicast </td>
2219 <td class="md" valign="top">( </td>
2220 <td class="md" nowrap valign="top">std::string </td>
2221 <td class="mdname" nowrap> <em>destination</em>, </td>
2226 <td class="md" nowrap>std::string </td>
2227 <td class="mdname" nowrap> <em>text</em></td>
2231 <td class="md">) </td>
2232 <td class="md" colspan="2"><code> [virtual]</code></td>
2239 <table cellspacing=5 cellpadding=0 border=0>
2247 This function sends a line of text directly to a server.
2249 If the server is not directly routable at this time, the server attempts to route text through the mesh.
2251 Definition at line <a class="el" href="modules_8cpp-source.html#l00734">734</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2253 <div class="fragment"><pre>00735 {
2254 00736 NetSendToOne((<span class="keywordtype">char</span>*)destination.c_str(),(<span class="keywordtype">char</span>*)text.c_str());
2259 <a name="a27" doxytag="Server::PartUserFromChannel"></a><p>
2260 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2263 <table cellpadding="0" cellspacing="0" border="0">
2265 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::PartUserFromChannel </td>
2266 <td class="md" valign="top">( </td>
2267 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2268 <td class="mdname" nowrap> <em>user</em>, </td>
2273 <td class="md" nowrap>std::string </td>
2274 <td class="mdname" nowrap> <em>cname</em>, </td>
2279 <td class="md" nowrap>std::string </td>
2280 <td class="mdname" nowrap> <em>reason</em></td>
2284 <td class="md">) </td>
2285 <td class="md" colspan="2"><code> [virtual]</code></td>
2292 <table cellspacing=5 cellpadding=0 border=0>
2300 Forces a user to part a channel.
2302 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.
2304 Definition at line <a class="el" href="modules_8cpp-source.html#l00386">386</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2306 <div class="fragment"><pre>00387 {
2307 00388 <span class="keywordflow">return</span> del_channel(user,cname.c_str(),reason.c_str(),<span class="keyword">false</span>);
2312 <a name="a37" doxytag="Server::PseudoToUser"></a><p>
2313 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2316 <table cellpadding="0" cellspacing="0" border="0">
2318 <td class="md" nowrap valign="top"> bool Server::PseudoToUser </td>
2319 <td class="md" valign="top">( </td>
2320 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2321 <td class="mdname" nowrap> <em>alive</em>, </td>
2326 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2327 <td class="mdname" nowrap> <em>zombie</em>, </td>
2332 <td class="md" nowrap>std::string </td>
2333 <td class="mdname" nowrap> <em>message</em></td>
2337 <td class="md">) </td>
2338 <td class="md" colspan="2"><code> [virtual]</code></td>
2345 <table cellspacing=5 cellpadding=0 border=0>
2353 This user takes one user, and switches their file descriptor with another user, so that one user "becomes" the other.
2355 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.
2357 Definition at line <a class="el" href="modules_8cpp-source.html#l00604">604</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2359 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#l00171">connection::fd</a>, <a class="el" href="modules_8h-source.html#l00099">FD_MAGIC_NUMBER</a>, <a class="el" href="connection_8h-source.html#l00175">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>.
2361 <div class="fragment"><pre>00605 {
2362 00606 zombie-><a class="code" href="classconnection.html#o0">fd</a> = alive-><a class="code" href="classconnection.html#o0">fd</a>;
2363 00607 alive-><a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="modules_8h.html#a26">FD_MAGIC_NUMBER</a>;
2364 00608 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>);
2365 00609 kill_link(alive,message.c_str());
2366 00610 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i != MAXCHANS; i++)
2368 00612 <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)
2370 00614 <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>)
2372 00616 <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>;
2373 00617 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>);
2374 00618 <span class="keywordflow">if</span> (Ptr-><a class="code" href="classchanrec.html#o4">topicset</a>)
2376 00620 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>);
2377 00621 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>);
2379 00623 userlist(zombie,Ptr);
2380 00624 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>);
2381 00625 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));
2382 00626 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>);
2392 <a name="a29" doxytag="Server::QuitUser"></a><p>
2393 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2396 <table cellpadding="0" cellspacing="0" border="0">
2398 <td class="md" nowrap valign="top"> void Server::QuitUser </td>
2399 <td class="md" valign="top">( </td>
2400 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2401 <td class="mdname" nowrap> <em>user</em>, </td>
2406 <td class="md" nowrap>std::string </td>
2407 <td class="mdname" nowrap> <em>reason</em></td>
2411 <td class="md">) </td>
2412 <td class="md" colspan="2"><code> [virtual]</code></td>
2419 <table cellspacing=5 cellpadding=0 border=0>
2427 Forces a user to quit with the specified reason.
2429 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>
2431 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.
2433 Definition at line <a class="el" href="modules_8cpp-source.html#l00415">415</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2435 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>.
2437 <div class="fragment"><pre>00416 {
2438 00417 <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());
2439 00418 kill_link(user,reason.c_str());
2444 <a name="a4" doxytag="Server::Send"></a><p>
2445 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2448 <table cellpadding="0" cellspacing="0" border="0">
2450 <td class="md" nowrap valign="top"> void Server::Send </td>
2451 <td class="md" valign="top">( </td>
2452 <td class="md" nowrap valign="top">int </td>
2453 <td class="mdname" nowrap> <em>Socket</em>, </td>
2458 <td class="md" nowrap>std::string </td>
2459 <td class="mdname" nowrap> <em>s</em></td>
2463 <td class="md">) </td>
2464 <td class="md" colspan="2"><code> [virtual]</code></td>
2471 <table cellspacing=5 cellpadding=0 border=0>
2479 Sends a line of text down a TCP/IP socket.
2481 This method writes a line of text to an established socket, cutting it to 510 characters plus a carriage return and linefeed if required.
2483 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>.
2485 <div class="fragment"><pre>00447 {
2486 00448 Write(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
2491 <a name="a8" doxytag="Server::SendChannel"></a><p>
2492 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2495 <table cellpadding="0" cellspacing="0" border="0">
2497 <td class="md" nowrap valign="top"> void Server::SendChannel </td>
2498 <td class="md" valign="top">( </td>
2499 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2500 <td class="mdname" nowrap> <em>User</em>, </td>
2505 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
2506 <td class="mdname" nowrap> <em>Channel</em>, </td>
2511 <td class="md" nowrap>std::string </td>
2512 <td class="mdname" nowrap> <em>s</em>, </td>
2517 <td class="md" nowrap>bool </td>
2518 <td class="mdname" nowrap> <em>IncludeSender</em></td>
2522 <td class="md">) </td>
2523 <td class="md" colspan="2"><code> [virtual]</code></td>
2530 <table cellspacing=5 cellpadding=0 border=0>
2538 Sends text from a user to a channel (mulicast).
2540 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).
2542 Definition at line <a class="el" href="modules_8cpp-source.html#l00475">475</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2544 <div class="fragment"><pre>00476 {
2545 00477 <span class="keywordflow">if</span> (IncludeSender)
2547 00479 WriteChannel(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
2549 00481 <span class="keywordflow">else</span>
2551 00483 ChanExceptSender(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
2557 <a name="a10" doxytag="Server::SendCommon"></a><p>
2558 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2561 <table cellpadding="0" cellspacing="0" border="0">
2563 <td class="md" nowrap valign="top"> void Server::SendCommon </td>
2564 <td class="md" valign="top">( </td>
2565 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2566 <td class="mdname" nowrap> <em>User</em>, </td>
2571 <td class="md" nowrap>std::string </td>
2572 <td class="mdname" nowrap> <em>text</em>, </td>
2577 <td class="md" nowrap>bool </td>
2578 <td class="mdname" nowrap> <em>IncludeSender</em></td>
2582 <td class="md">) </td>
2583 <td class="md" colspan="2"><code> [virtual]</code></td>
2590 <table cellspacing=5 cellpadding=0 border=0>
2598 Sends text from a user to one or more channels (mulicast).
2600 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.
2602 Definition at line <a class="el" href="modules_8cpp-source.html#l00492">492</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2604 <div class="fragment"><pre>00493 {
2605 00494 <span class="keywordflow">if</span> (IncludeSender)
2607 00496 WriteCommon(User,<span class="stringliteral">"%s"</span>,text.c_str());
2609 00498 <span class="keywordflow">else</span>
2611 00500 WriteCommonExcept(User,<span class="stringliteral">"%s"</span>,text.c_str());
2617 <a name="a6" doxytag="Server::SendFrom"></a><p>
2618 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2621 <table cellpadding="0" cellspacing="0" border="0">
2623 <td class="md" nowrap valign="top"> void Server::SendFrom </td>
2624 <td class="md" valign="top">( </td>
2625 <td class="md" nowrap valign="top">int </td>
2626 <td class="mdname" nowrap> <em>Socket</em>, </td>
2631 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2632 <td class="mdname" nowrap> <em>User</em>, </td>
2637 <td class="md" nowrap>std::string </td>
2638 <td class="mdname" nowrap> <em>s</em></td>
2642 <td class="md">) </td>
2643 <td class="md" colspan="2"><code> [virtual]</code></td>
2650 <table cellspacing=5 cellpadding=0 border=0>
2658 Sends text from a user to a socket.
2660 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)
2662 Definition at line <a class="el" href="modules_8cpp-source.html#l00456">456</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2664 <div class="fragment"><pre>00457 {
2665 00458 WriteFrom(Socket,User,<span class="stringliteral">"%s"</span>,s.c_str());
2670 <a name="a24" doxytag="Server::SendMode"></a><p>
2671 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2674 <table cellpadding="0" cellspacing="0" border="0">
2676 <td class="md" nowrap valign="top"> void Server::SendMode </td>
2677 <td class="md" valign="top">( </td>
2678 <td class="md" nowrap valign="top">char ** </td>
2679 <td class="mdname" nowrap> <em>parameters</em>, </td>
2684 <td class="md" nowrap>int </td>
2685 <td class="mdname" nowrap> <em>pcnt</em>, </td>
2690 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2691 <td class="mdname" nowrap> <em>user</em></td>
2695 <td class="md">) </td>
2696 <td class="md" colspan="2"><code> [virtual]</code></td>
2703 <table cellspacing=5 cellpadding=0 border=0>
2713 you must format the parameters array with the target, modes and parameters for those modes.<p>
2716 modes[0] = ChannelName;<p>
2718 modes[2] = user->nick;<p>
2719 Srv->SendMode(modes,3,user);<p>
2720 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!
2722 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>.
2724 References <a class="el" href="modules_8h.html#a36">server_mode()</a>.
2726 <div class="fragment"><pre>00442 {
2727 00443 <a class="code" href="modules_8h.html#a36">server_mode</a>(parameters,pcnt,user);
2732 <a name="a2" doxytag="Server::SendOpers"></a><p>
2733 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2736 <table cellpadding="0" cellspacing="0" border="0">
2738 <td class="md" nowrap valign="top"> void Server::SendOpers </td>
2739 <td class="md" valign="top">( </td>
2740 <td class="md" nowrap valign="top">std::string </td>
2741 <td class="mdname1" valign="top" nowrap> <em>s</em> </td>
2742 <td class="md" valign="top"> ) </td>
2743 <td class="md" nowrap><code> [virtual]</code></td>
2750 <table cellspacing=5 cellpadding=0 border=0>
2758 Sends text to all opers.
2760 This method sends a server notice to all opers with the usermode +s.
2762 Definition at line <a class="el" href="modules_8cpp-source.html#l00363">363</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2764 <div class="fragment"><pre>00364 {
2765 00365 WriteOpers(<span class="stringliteral">"%s"</span>,s.c_str());
2770 <a name="a5" doxytag="Server::SendServ"></a><p>
2771 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2774 <table cellpadding="0" cellspacing="0" border="0">
2776 <td class="md" nowrap valign="top"> void Server::SendServ </td>
2777 <td class="md" valign="top">( </td>
2778 <td class="md" nowrap valign="top">int </td>
2779 <td class="mdname" nowrap> <em>Socket</em>, </td>
2784 <td class="md" nowrap>std::string </td>
2785 <td class="mdname" nowrap> <em>s</em></td>
2789 <td class="md">) </td>
2790 <td class="md" colspan="2"><code> [virtual]</code></td>
2797 <table cellspacing=5 cellpadding=0 border=0>
2805 Sends text from the server to a socket.
2807 This method writes a line of text to an established socket, with the servername prepended as used by numerics (see RFC 1459)
2809 Definition at line <a class="el" href="modules_8cpp-source.html#l00451">451</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2811 <div class="fragment"><pre>00452 {
2812 00453 WriteServ(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
2817 <a name="a7" doxytag="Server::SendTo"></a><p>
2818 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2821 <table cellpadding="0" cellspacing="0" border="0">
2823 <td class="md" nowrap valign="top"> void Server::SendTo </td>
2824 <td class="md" valign="top">( </td>
2825 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2826 <td class="mdname" nowrap> <em>Source</em>, </td>
2831 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2832 <td class="mdname" nowrap> <em>Dest</em>, </td>
2837 <td class="md" nowrap>std::string </td>
2838 <td class="mdname" nowrap> <em>s</em></td>
2842 <td class="md">) </td>
2843 <td class="md" colspan="2"><code> [virtual]</code></td>
2850 <table cellspacing=5 cellpadding=0 border=0>
2858 Sends text from a user to another user.
2860 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>
2862 The format will become:<p>
2863 :localserver TEXT<p>
2864 Which is useful for numerics and server notices to single users, etc.
2866 Definition at line <a class="el" href="modules_8cpp-source.html#l00461">461</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2868 References <a class="el" href="connection_8h-source.html#l00171">connection::fd</a>.
2870 <div class="fragment"><pre>00462 {
2871 00463 <span class="keywordflow">if</span> (!Source)
2873 00465 <span class="comment">// if source is NULL, then the message originates from the local server</span>
2874 00466 Write(Dest-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">":%s %s"</span>,this->GetServerName().c_str(),s.c_str());
2876 00468 <span class="keywordflow">else</span>
2878 00470 <span class="comment">// otherwise it comes from the user specified</span>
2879 00471 WriteTo(Source,Dest,<span class="stringliteral">"%s"</span>,s.c_str());
2885 <a name="a25" doxytag="Server::SendToModeMask"></a><p>
2886 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2889 <table cellpadding="0" cellspacing="0" border="0">
2891 <td class="md" nowrap valign="top"> void Server::SendToModeMask </td>
2892 <td class="md" valign="top">( </td>
2893 <td class="md" nowrap valign="top">std::string </td>
2894 <td class="mdname" nowrap> <em>modes</em>, </td>
2899 <td class="md" nowrap>int </td>
2900 <td class="mdname" nowrap> <em>flags</em>, </td>
2905 <td class="md" nowrap>std::string </td>
2906 <td class="mdname" nowrap> <em>text</em></td>
2910 <td class="md">) </td>
2911 <td class="md" colspan="2"><code> [virtual]</code></td>
2918 <table cellspacing=5 cellpadding=0 border=0>
2926 Sends to all users matching a mode mask You must specify one or more usermodes as the first parameter.
2928 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>
2929 Serv->SendToModeMask("xi", WM_OR, "m00");<p>
2930 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.
2932 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>.
2934 <div class="fragment"><pre>00377 {
2935 00378 WriteMode(modes.c_str(),flags,<span class="stringliteral">"%s"</span>,text.c_str());
2940 <a name="a11" doxytag="Server::SendWallops"></a><p>
2941 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2944 <table cellpadding="0" cellspacing="0" border="0">
2946 <td class="md" nowrap valign="top"> void Server::SendWallops </td>
2947 <td class="md" valign="top">( </td>
2948 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2949 <td class="mdname" nowrap> <em>User</em>, </td>
2954 <td class="md" nowrap>std::string </td>
2955 <td class="mdname" nowrap> <em>text</em></td>
2959 <td class="md">) </td>
2960 <td class="md" colspan="2"><code> [virtual]</code></td>
2967 <table cellspacing=5 cellpadding=0 border=0>
2975 Sends a WALLOPS message.
2977 This method writes a WALLOPS message to all users with the +w flag, originating from the specified user.
2979 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>.
2981 <div class="fragment"><pre>00505 {
2982 00506 WriteWallOps(User,<span class="keyword">false</span>,<span class="stringliteral">"%s"</span>,text.c_str());
2987 <a name="a36" doxytag="Server::UserToPseudo"></a><p>
2988 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2991 <table cellpadding="0" cellspacing="0" border="0">
2993 <td class="md" nowrap valign="top"> bool Server::UserToPseudo </td>
2994 <td class="md" valign="top">( </td>
2995 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2996 <td class="mdname" nowrap> <em>user</em>, </td>
3001 <td class="md" nowrap>std::string </td>
3002 <td class="mdname" nowrap> <em>message</em></td>
3006 <td class="md">) </td>
3007 <td class="md" colspan="2"><code> [virtual]</code></td>
3014 <table cellspacing=5 cellpadding=0 border=0>
3022 Remove a user's connection to the irc server, but leave their client in existence in the user hash.
3024 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.
3026 Definition at line <a class="el" href="modules_8cpp-source.html#l00595">595</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
3028 References <a class="el" href="connection_8h-source.html#l00171">connection::fd</a>, <a class="el" href="modules_8h-source.html#l00099">FD_MAGIC_NUMBER</a>, <a class="el" href="connection_8h-source.html#l00175">connection::host</a>, and <a class="el" href="users_8h-source.html#l00110">userrec::ident</a>.
3030 <div class="fragment"><pre>00596 {
3031 00597 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> old_fd = user-><a class="code" href="classconnection.html#o0">fd</a>;
3032 00598 user-><a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="modules_8h.html#a26">FD_MAGIC_NUMBER</a>;
3033 00599 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());
3034 00600 close(old_fd);
3035 00601 shutdown (old_fd,2);
3040 <hr>The documentation for this class was generated from the following files:<ul>
3041 <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>
3042 <hr size="1"><address style="align: right;"><small>Generated on Sat Apr 16 18:57:22 2005 for InspIRCd by
3043 <a href="http://www.doxygen.org/index.html">
3044 <img src="doxygen.png" alt="doxygen" align="middle" border=0 >
3045 </a>1.3.3 </small></address>