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>
169 <hr><a name="_details"></a><h2>Detailed Description</h2>
170 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.
172 All modules should instantiate at least one copy of this class, and use its member functions to perform their tasks.
176 Definition at line <a class="el" href="modules_8h-source.html#l00493">493</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor & Destructor Documentation</h2>
177 <a name="a0" doxytag="Server::Server"></a><p>
178 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
181 <table cellpadding="0" cellspacing="0" border="0">
183 <td class="md" nowrap valign="top"> Server::Server </td>
184 <td class="md" valign="top">( </td>
185 <td class="mdname1" valign="top" nowrap> </td>
186 <td class="md" valign="top"> ) </td>
187 <td class="md" nowrap></td>
194 <table cellspacing=5 cellpadding=0 border=0>
204 Creates a Server object.
206 Definition at line <a class="el" href="modules_8cpp-source.html#l00354">354</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
208 <div class="fragment"><pre>00355 {
213 <a name="a1" doxytag="Server::~Server"></a><p>
214 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
217 <table cellpadding="0" cellspacing="0" border="0">
219 <td class="md" nowrap valign="top"> Server::~<a class="el" href="classServer.html">Server</a> </td>
220 <td class="md" valign="top">( </td>
221 <td class="mdname1" valign="top" nowrap> </td>
222 <td class="md" valign="top"> ) </td>
223 <td class="md" nowrap><code> [virtual]</code></td>
230 <table cellspacing=5 cellpadding=0 border=0>
240 Destroys a Server object.
242 Definition at line <a class="el" href="modules_8cpp-source.html#l00358">358</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
244 <div class="fragment"><pre>00359 {
249 <hr><h2>Member Function Documentation</h2>
250 <a name="a23" doxytag="Server::AddCommand"></a><p>
251 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
254 <table cellpadding="0" cellspacing="0" border="0">
256 <td class="md" nowrap valign="top"> void Server::AddCommand </td>
257 <td class="md" valign="top">( </td>
258 <td class="md" nowrap valign="top">char * </td>
259 <td class="mdname" nowrap> <em>cmd</em>, </td>
264 <td class="md" nowrap>handlerfunc </td>
265 <td class="mdname" nowrap> <em>f</em>, </td>
270 <td class="md" nowrap>char </td>
271 <td class="mdname" nowrap> <em>flags</em>, </td>
276 <td class="md" nowrap>int </td>
277 <td class="mdname" nowrap> <em>minparams</em>, </td>
282 <td class="md" nowrap>char * </td>
283 <td class="mdname" nowrap> <em>source</em></td>
287 <td class="md">) </td>
288 <td class="md" colspan="2"><code> [virtual]</code></td>
295 <table cellspacing=5 cellpadding=0 border=0>
303 Adds a command to the command table.
305 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>
306 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>
307 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.
309 Definition at line <a class="el" href="modules_8cpp-source.html#l00435">435</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
311 References <a class="el" href="modules_8h.html#a35">createcommand()</a>.
313 <div class="fragment"><pre>00436 {
314 00437 <a class="code" href="modules_8h.html#a35">createcommand</a>(cmd,f,flags,minparams,source);
319 <a name="a42" doxytag="Server::AddELine"></a><p>
320 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
323 <table cellpadding="0" cellspacing="0" border="0">
325 <td class="md" nowrap valign="top"> void Server::AddELine </td>
326 <td class="md" valign="top">( </td>
327 <td class="md" nowrap valign="top">long </td>
328 <td class="mdname" nowrap> <em>duration</em>, </td>
333 <td class="md" nowrap>std::string </td>
334 <td class="mdname" nowrap> <em>source</em>, </td>
339 <td class="md" nowrap>std::string </td>
340 <td class="mdname" nowrap> <em>reason</em>, </td>
345 <td class="md" nowrap>std::string </td>
346 <td class="mdname" nowrap> <em>hostmask</em></td>
350 <td class="md">) </td>
351 <td class="md" colspan="2"><code> [virtual]</code></td>
358 <table cellspacing=5 cellpadding=0 border=0>
366 Adds a E-line The E-line is enforced as soon as it is added.
368 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.
370 Definition at line <a class="el" href="modules_8cpp-source.html#l00653">653</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
372 References <a class="el" href="xline_8h.html#a5">add_eline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
374 <div class="fragment"><pre>00654 {
375 00655 <a class="code" href="xline_8h.html#a5">add_eline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
380 <a name="a22" doxytag="Server::AddExtendedListMode"></a><p>
381 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
384 <table cellpadding="0" cellspacing="0" border="0">
386 <td class="md" nowrap valign="top"> bool Server::AddExtendedListMode </td>
387 <td class="md" valign="top">( </td>
388 <td class="md" nowrap valign="top">char </td>
389 <td class="mdname1" valign="top" nowrap> <em>modechar</em> </td>
390 <td class="md" valign="top"> ) </td>
391 <td class="md" nowrap><code> [virtual]</code></td>
398 <table cellspacing=5 cellpadding=0 border=0>
406 Adds an extended mode letter which is parsed by a module and handled in a list fashion.
408 This call is used to implement modes like +q and +a. The characteristics of these modes are as follows:<p>
409 (1) They are ALWAYS on channels, not on users, therefore their type is MT_CHANNEL<p>
410 (2) They always take exactly one parameter when being added or removed<p>
411 (3) They can be set multiple times, usually on users in channels<p>
412 (4) The mode and its parameter are NOT stored in the channels modes structure<p>
413 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.
415 Definition at line <a class="el" href="modules_8cpp-source.html#l00580">580</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
417 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>.
419 <div class="fragment"><pre>00581 {
420 00582 <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);
421 00583 <span class="keywordflow">if</span> (res)
422 00584 <a class="code" href="modules_8cpp.html#a58">ModeMakeList</a>(modechar);
423 00585 <span class="keywordflow">return</span> res;
428 <a name="a21" doxytag="Server::AddExtendedMode"></a><p>
429 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
432 <table cellpadding="0" cellspacing="0" border="0">
434 <td class="md" nowrap valign="top"> bool Server::AddExtendedMode </td>
435 <td class="md" valign="top">( </td>
436 <td class="md" nowrap valign="top">char </td>
437 <td class="mdname" nowrap> <em>modechar</em>, </td>
442 <td class="md" nowrap>int </td>
443 <td class="mdname" nowrap> <em>type</em>, </td>
448 <td class="md" nowrap>bool </td>
449 <td class="mdname" nowrap> <em>requires_oper</em>, </td>
454 <td class="md" nowrap>int </td>
455 <td class="mdname" nowrap> <em>params_when_on</em>, </td>
460 <td class="md" nowrap>int </td>
461 <td class="mdname" nowrap> <em>params_when_off</em></td>
465 <td class="md">) </td>
466 <td class="md" colspan="2"><code> [virtual]</code></td>
473 <table cellspacing=5 cellpadding=0 border=0>
481 Adds an extended mode letter which is parsed by a module.
483 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.
485 Definition at line <a class="el" href="modules_8cpp-source.html#l00560">560</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
487 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>.
489 <div class="fragment"><pre>00561 {
490 00562 <span class="keywordflow">if</span> (type == <a class="code" href="modules_8h.html#a7">MT_SERVER</a>)
492 00564 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion"</span>);
493 00565 <span class="keywordflow">return</span> <span class="keyword">false</span>;
495 00567 <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>))
497 00569 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Parameters on MT_CLIENT modes are not supported"</span>);
498 00570 <span class="keywordflow">return</span> <span class="keyword">false</span>;
500 00572 <span class="keywordflow">if</span> ((params_when_on>1) || (params_when_off>1))
502 00574 log(DEBUG,<span class="stringliteral">"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported"</span>);
503 00575 <span class="keywordflow">return</span> <span class="keyword">false</span>;
505 00577 <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);
510 <a name="a38" doxytag="Server::AddGLine"></a><p>
511 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
514 <table cellpadding="0" cellspacing="0" border="0">
516 <td class="md" nowrap valign="top"> void Server::AddGLine </td>
517 <td class="md" valign="top">( </td>
518 <td class="md" nowrap valign="top">long </td>
519 <td class="mdname" nowrap> <em>duration</em>, </td>
524 <td class="md" nowrap>std::string </td>
525 <td class="mdname" nowrap> <em>source</em>, </td>
530 <td class="md" nowrap>std::string </td>
531 <td class="mdname" nowrap> <em>reason</em>, </td>
536 <td class="md" nowrap>std::string </td>
537 <td class="mdname" nowrap> <em>hostmask</em></td>
541 <td class="md">) </td>
542 <td class="md" colspan="2"><code> [virtual]</code></td>
549 <table cellspacing=5 cellpadding=0 border=0>
557 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.
559 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.
561 Definition at line <a class="el" href="modules_8cpp-source.html#l00633">633</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
563 References <a class="el" href="xline_8h.html#a1">add_gline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
565 <div class="fragment"><pre>00634 {
566 00635 <a class="code" href="xline_8h.html#a1">add_gline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
571 <a name="a41" doxytag="Server::AddKLine"></a><p>
572 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
575 <table cellpadding="0" cellspacing="0" border="0">
577 <td class="md" nowrap valign="top"> void Server::AddKLine </td>
578 <td class="md" valign="top">( </td>
579 <td class="md" nowrap valign="top">long </td>
580 <td class="mdname" nowrap> <em>duration</em>, </td>
585 <td class="md" nowrap>std::string </td>
586 <td class="mdname" nowrap> <em>source</em>, </td>
591 <td class="md" nowrap>std::string </td>
592 <td class="mdname" nowrap> <em>reason</em>, </td>
597 <td class="md" nowrap>std::string </td>
598 <td class="mdname" nowrap> <em>hostmask</em></td>
602 <td class="md">) </td>
603 <td class="md" colspan="2"><code> [virtual]</code></td>
610 <table cellspacing=5 cellpadding=0 border=0>
618 Adds a K-line The K-line is enforced as soon as it is added.
620 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.
622 Definition at line <a class="el" href="modules_8cpp-source.html#l00648">648</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
624 References <a class="el" href="xline_8h.html#a4">add_kline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
626 <div class="fragment"><pre>00649 {
627 00650 <a class="code" href="xline_8h.html#a4">add_kline</a>(duration, source.c_str(), reason.c_str(), hostmask.c_str());
632 <a name="a39" doxytag="Server::AddQLine"></a><p>
633 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
636 <table cellpadding="0" cellspacing="0" border="0">
638 <td class="md" nowrap valign="top"> void Server::AddQLine </td>
639 <td class="md" valign="top">( </td>
640 <td class="md" nowrap valign="top">long </td>
641 <td class="mdname" nowrap> <em>duration</em>, </td>
646 <td class="md" nowrap>std::string </td>
647 <td class="mdname" nowrap> <em>source</em>, </td>
652 <td class="md" nowrap>std::string </td>
653 <td class="mdname" nowrap> <em>reason</em>, </td>
658 <td class="md" nowrap>std::string </td>
659 <td class="mdname" nowrap> <em>nickname</em></td>
663 <td class="md">) </td>
664 <td class="md" colspan="2"><code> [virtual]</code></td>
671 <table cellspacing=5 cellpadding=0 border=0>
679 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.
681 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.
683 Definition at line <a class="el" href="modules_8cpp-source.html#l00638">638</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
685 References <a class="el" href="xline_8h.html#a2">add_qline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
687 <div class="fragment"><pre>00639 {
688 00640 <a class="code" href="xline_8h.html#a2">add_qline</a>(duration, source.c_str(), reason.c_str(), nickname.c_str());
693 <a name="a40" doxytag="Server::AddZLine"></a><p>
694 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
697 <table cellpadding="0" cellspacing="0" border="0">
699 <td class="md" nowrap valign="top"> void Server::AddZLine </td>
700 <td class="md" valign="top">( </td>
701 <td class="md" nowrap valign="top">long </td>
702 <td class="mdname" nowrap> <em>duration</em>, </td>
707 <td class="md" nowrap>std::string </td>
708 <td class="mdname" nowrap> <em>source</em>, </td>
713 <td class="md" nowrap>std::string </td>
714 <td class="mdname" nowrap> <em>reason</em>, </td>
719 <td class="md" nowrap>std::string </td>
720 <td class="mdname" nowrap> <em>ipaddr</em></td>
724 <td class="md">) </td>
725 <td class="md" colspan="2"><code> [virtual]</code></td>
732 <table cellspacing=5 cellpadding=0 border=0>
740 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.
742 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.
744 Definition at line <a class="el" href="modules_8cpp-source.html#l00643">643</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
746 References <a class="el" href="xline_8h.html#a3">add_zline()</a>, and <a class="el" href="commands_8h.html#a75">duration()</a>.
748 <div class="fragment"><pre>00644 {
749 00645 <a class="code" href="xline_8h.html#a3">add_zline</a>(duration, source.c_str(), reason.c_str(), ipaddr.c_str());
754 <a name="a48" doxytag="Server::CalcDuration"></a><p>
755 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
758 <table cellpadding="0" cellspacing="0" border="0">
760 <td class="md" nowrap valign="top"> long Server::CalcDuration </td>
761 <td class="md" valign="top">( </td>
762 <td class="md" nowrap valign="top">std::string </td>
763 <td class="mdname1" valign="top" nowrap> <em>duration</em> </td>
764 <td class="md" valign="top"> ) </td>
765 <td class="md" nowrap><code> [virtual]</code></td>
772 <table cellspacing=5 cellpadding=0 border=0>
780 Calculates a duration This method will take a string containing a formatted duration (e.g.
782 "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.
784 Definition at line <a class="el" href="modules_8cpp-source.html#l00683">683</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
786 References <a class="el" href="commands_8h.html#a75">duration()</a>.
788 <div class="fragment"><pre>00684 {
789 00685 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a75">duration</a>(delta.c_str());
794 <a name="a31" doxytag="Server::CallCommandHandler"></a><p>
795 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
798 <table cellpadding="0" cellspacing="0" border="0">
800 <td class="md" nowrap valign="top"> void Server::CallCommandHandler </td>
801 <td class="md" valign="top">( </td>
802 <td class="md" nowrap valign="top">std::string </td>
803 <td class="mdname" nowrap> <em>commandname</em>, </td>
808 <td class="md" nowrap>char ** </td>
809 <td class="mdname" nowrap> <em>parameters</em>, </td>
814 <td class="md" nowrap>int </td>
815 <td class="mdname" nowrap> <em>pcnt</em>, </td>
820 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
821 <td class="mdname" nowrap> <em>user</em></td>
825 <td class="md">) </td>
826 <td class="md" colspan="2"><code> [virtual]</code></td>
833 <table cellspacing=5 cellpadding=0 border=0>
841 Calls the handler for a command, either implemented by the core or by another module.
843 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>
844 ) 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.
846 Definition at line <a class="el" href="modules_8cpp-source.html#l00425">425</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
848 <div class="fragment"><pre>00426 {
849 00427 call_handler(commandname.c_str(),parameters,pcnt,user);
854 <a name="a33" doxytag="Server::ChangeGECOS"></a><p>
855 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
858 <table cellpadding="0" cellspacing="0" border="0">
860 <td class="md" nowrap valign="top"> void Server::ChangeGECOS </td>
861 <td class="md" valign="top">( </td>
862 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
863 <td class="mdname" nowrap> <em>user</em>, </td>
868 <td class="md" nowrap>std::string </td>
869 <td class="mdname" nowrap> <em>gecos</em></td>
873 <td class="md">) </td>
874 <td class="md" colspan="2"><code> [virtual]</code></td>
881 <table cellspacing=5 cellpadding=0 border=0>
889 Change GECOS (fullname) of a user.
891 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.
893 Definition at line <a class="el" href="modules_8cpp-source.html#l00513">513</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
895 References <a class="el" href="message_8h.html#a10">ChangeName()</a>.
897 <div class="fragment"><pre>00514 {
898 00515 <a class="code" href="message_8h.html#a10">ChangeName</a>(user,gecos.c_str());
903 <a name="a32" doxytag="Server::ChangeHost"></a><p>
904 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
907 <table cellpadding="0" cellspacing="0" border="0">
909 <td class="md" nowrap valign="top"> void Server::ChangeHost </td>
910 <td class="md" valign="top">( </td>
911 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
912 <td class="mdname" nowrap> <em>user</em>, </td>
917 <td class="md" nowrap>std::string </td>
918 <td class="mdname" nowrap> <em>host</em></td>
922 <td class="md">) </td>
923 <td class="md" colspan="2"><code> [virtual]</code></td>
930 <table cellspacing=5 cellpadding=0 border=0>
938 Change displayed hostname of a user.
940 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.
942 Definition at line <a class="el" href="modules_8cpp-source.html#l00508">508</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
944 References <a class="el" href="message_8h.html#a11">ChangeDisplayedHost()</a>.
946 <div class="fragment"><pre>00509 {
947 00510 <a class="code" href="message_8h.html#a11">ChangeDisplayedHost</a>(user,host.c_str());
952 <a name="a28" doxytag="Server::ChangeUserNick"></a><p>
953 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
956 <table cellpadding="0" cellspacing="0" border="0">
958 <td class="md" nowrap valign="top"> void Server::ChangeUserNick </td>
959 <td class="md" valign="top">( </td>
960 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
961 <td class="mdname" nowrap> <em>user</em>, </td>
966 <td class="md" nowrap>std::string </td>
967 <td class="mdname" nowrap> <em>nickname</em></td>
971 <td class="md">) </td>
972 <td class="md" colspan="2"><code> [virtual]</code></td>
979 <table cellspacing=5 cellpadding=0 border=0>
987 Forces a user nickchange.
989 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.
991 Definition at line <a class="el" href="modules_8cpp-source.html#l00409">409</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
993 <div class="fragment"><pre>00410 {
994 00411 force_nickchange(user,nickname.c_str());
999 <a name="a16" doxytag="Server::ChanMode"></a><p>
1000 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1003 <table cellpadding="0" cellspacing="0" border="0">
1005 <td class="md" nowrap valign="top"> std::string Server::ChanMode </td>
1006 <td class="md" valign="top">( </td>
1007 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1008 <td class="mdname" nowrap> <em>User</em>, </td>
1013 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
1014 <td class="mdname" nowrap> <em>Chan</em></td>
1018 <td class="md">) </td>
1019 <td class="md" colspan="2"><code> [virtual]</code></td>
1026 <table cellspacing=5 cellpadding=0 border=0>
1034 Attempts to look up a user's privilages on a channel.
1036 This function will return a string containing either @, , +, or an empty string, representing the user's privilages upon the channel you specify.
1038 Definition at line <a class="el" href="modules_8cpp-source.html#l00533">533</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1040 References <a class="el" href="message_8h.html#a14">cmode()</a>.
1042 <div class="fragment"><pre>00534 {
1043 00535 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a14">cmode</a>(User,Chan);
1048 <a name="a9" doxytag="Server::CommonChannels"></a><p>
1049 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1052 <table cellpadding="0" cellspacing="0" border="0">
1054 <td class="md" nowrap valign="top"> bool Server::CommonChannels </td>
1055 <td class="md" valign="top">( </td>
1056 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1057 <td class="mdname" nowrap> <em>u1</em>, </td>
1062 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
1063 <td class="mdname" nowrap> <em>u2</em></td>
1067 <td class="md">) </td>
1068 <td class="md" colspan="2"><code> [virtual]</code></td>
1075 <table cellspacing=5 cellpadding=0 border=0>
1083 Returns true if two users share a common channel.
1085 This method is used internally by the NICK and QUIT commands, and the <a class="el" href="classServer.html#a10">Server::SendCommon</a> method.
1087 Definition at line <a class="el" href="modules_8cpp-source.html#l00486">486</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1089 References <a class="el" href="message_8h.html#a0">common_channels()</a>.
1091 <div class="fragment"><pre>00487 {
1092 00488 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a0">common_channels</a>(u1,u2) != 0);
1097 <a name="a13" doxytag="Server::CountUsers"></a><p>
1098 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1101 <table cellpadding="0" cellspacing="0" border="0">
1103 <td class="md" nowrap valign="top"> int Server::CountUsers </td>
1104 <td class="md" valign="top">( </td>
1105 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
1106 <td class="mdname1" valign="top" nowrap> <em>c</em> </td>
1107 <td class="md" valign="top"> ) </td>
1108 <td class="md" nowrap><code> [virtual]</code></td>
1115 <table cellspacing=5 cellpadding=0 border=0>
1123 Returns a count of the number of users on a channel.
1125 This will NEVER be 0, as if the chanrec exists, it will have at least one user in the channel.
1127 Definition at line <a class="el" href="modules_8cpp-source.html#l00588">588</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1129 <div class="fragment"><pre>00589 {
1130 00590 <span class="keywordflow">return</span> usercount(c);
1135 <a name="a47" doxytag="Server::DelELine"></a><p>
1136 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1139 <table cellpadding="0" cellspacing="0" border="0">
1141 <td class="md" nowrap valign="top"> bool Server::DelELine </td>
1142 <td class="md" valign="top">( </td>
1143 <td class="md" nowrap valign="top">std::string </td>
1144 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1145 <td class="md" valign="top"> ) </td>
1146 <td class="md" nowrap><code> [virtual]</code></td>
1153 <table cellspacing=5 cellpadding=0 border=0>
1161 Deletes a local E-Line.
1165 Definition at line <a class="el" href="modules_8cpp-source.html#l00678">678</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1167 References <a class="el" href="xline_8h.html#a10">del_eline()</a>.
1169 <div class="fragment"><pre>00679 {
1170 00680 <a class="code" href="xline_8h.html#a10">del_eline</a>(hostmask.c_str());
1175 <a name="a43" doxytag="Server::DelGLine"></a><p>
1176 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1179 <table cellpadding="0" cellspacing="0" border="0">
1181 <td class="md" nowrap valign="top"> bool Server::DelGLine </td>
1182 <td class="md" valign="top">( </td>
1183 <td class="md" nowrap valign="top">std::string </td>
1184 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1185 <td class="md" valign="top"> ) </td>
1186 <td class="md" nowrap><code> [virtual]</code></td>
1193 <table cellspacing=5 cellpadding=0 border=0>
1201 Deletes a G-Line from all servers on the mesh.
1205 Definition at line <a class="el" href="modules_8cpp-source.html#l00658">658</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1207 References <a class="el" href="xline_8h.html#a6">del_gline()</a>.
1209 <div class="fragment"><pre>00659 {
1210 00660 <a class="code" href="xline_8h.html#a6">del_gline</a>(hostmask.c_str());
1215 <a name="a46" doxytag="Server::DelKLine"></a><p>
1216 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1219 <table cellpadding="0" cellspacing="0" border="0">
1221 <td class="md" nowrap valign="top"> bool Server::DelKLine </td>
1222 <td class="md" valign="top">( </td>
1223 <td class="md" nowrap valign="top">std::string </td>
1224 <td class="mdname1" valign="top" nowrap> <em>hostmask</em> </td>
1225 <td class="md" valign="top"> ) </td>
1226 <td class="md" nowrap><code> [virtual]</code></td>
1233 <table cellspacing=5 cellpadding=0 border=0>
1241 Deletes a local K-Line.
1245 Definition at line <a class="el" href="modules_8cpp-source.html#l00673">673</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1247 References <a class="el" href="xline_8h.html#a9">del_kline()</a>.
1249 <div class="fragment"><pre>00674 {
1250 00675 <a class="code" href="xline_8h.html#a9">del_kline</a>(hostmask.c_str());
1255 <a name="a44" doxytag="Server::DelQLine"></a><p>
1256 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1259 <table cellpadding="0" cellspacing="0" border="0">
1261 <td class="md" nowrap valign="top"> bool Server::DelQLine </td>
1262 <td class="md" valign="top">( </td>
1263 <td class="md" nowrap valign="top">std::string </td>
1264 <td class="mdname1" valign="top" nowrap> <em>nickname</em> </td>
1265 <td class="md" valign="top"> ) </td>
1266 <td class="md" nowrap><code> [virtual]</code></td>
1273 <table cellspacing=5 cellpadding=0 border=0>
1281 Deletes a Q-Line from all servers on the mesh.
1285 Definition at line <a class="el" href="modules_8cpp-source.html#l00663">663</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1287 References <a class="el" href="xline_8h.html#a7">del_qline()</a>.
1289 <div class="fragment"><pre>00664 {
1290 00665 <a class="code" href="xline_8h.html#a7">del_qline</a>(nickname.c_str());
1295 <a name="a45" doxytag="Server::DelZLine"></a><p>
1296 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1299 <table cellpadding="0" cellspacing="0" border="0">
1301 <td class="md" nowrap valign="top"> bool Server::DelZLine </td>
1302 <td class="md" valign="top">( </td>
1303 <td class="md" nowrap valign="top">std::string </td>
1304 <td class="mdname1" valign="top" nowrap> <em>ipaddr</em> </td>
1305 <td class="md" valign="top"> ) </td>
1306 <td class="md" nowrap><code> [virtual]</code></td>
1313 <table cellspacing=5 cellpadding=0 border=0>
1321 Deletes a Z-Line from all servers on the mesh.
1325 Definition at line <a class="el" href="modules_8cpp-source.html#l00668">668</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1327 References <a class="el" href="xline_8h.html#a8">del_zline()</a>.
1329 <div class="fragment"><pre>00669 {
1330 00670 <a class="code" href="xline_8h.html#a8">del_zline</a>(ipaddr.c_str());
1335 <a name="a15" doxytag="Server::FindChannel"></a><p>
1336 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1339 <table cellpadding="0" cellspacing="0" border="0">
1341 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::FindChannel </td>
1342 <td class="md" valign="top">( </td>
1343 <td class="md" nowrap valign="top">std::string </td>
1344 <td class="mdname1" valign="top" nowrap> <em>channel</em> </td>
1345 <td class="md" valign="top"> ) </td>
1346 <td class="md" nowrap><code> [virtual]</code></td>
1353 <table cellspacing=5 cellpadding=0 border=0>
1361 Attempts to look up a channel and return a pointer to it.
1363 This function will return NULL if the channel does not exist.
1365 Definition at line <a class="el" href="modules_8cpp-source.html#l00528">528</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1367 <div class="fragment"><pre>00529 {
1368 00530 <span class="keywordflow">return</span> FindChan(channel.c_str());
1373 <a name="a14" doxytag="Server::FindNick"></a><p>
1374 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1377 <table cellpadding="0" cellspacing="0" border="0">
1379 <td class="md" nowrap valign="top"> <a class="el" href="classuserrec.html">userrec</a> * Server::FindNick </td>
1380 <td class="md" valign="top">( </td>
1381 <td class="md" nowrap valign="top">std::string </td>
1382 <td class="mdname1" valign="top" nowrap> <em>nick</em> </td>
1383 <td class="md" valign="top"> ) </td>
1384 <td class="md" nowrap><code> [virtual]</code></td>
1391 <table cellspacing=5 cellpadding=0 border=0>
1399 Attempts to look up a nick and return a pointer to it.
1401 This function will return NULL if the nick does not exist.
1403 Definition at line <a class="el" href="modules_8cpp-source.html#l00523">523</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1405 <div class="fragment"><pre>00524 {
1406 00525 <span class="keywordflow">return</span> Find(nick);
1411 <a name="a20" doxytag="Server::GetAdmin"></a><p>
1412 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1415 <table cellpadding="0" cellspacing="0" border="0">
1417 <td class="md" nowrap valign="top"> <a class="el" href="classAdmin.html">Admin</a> Server::GetAdmin </td>
1418 <td class="md" valign="top">( </td>
1419 <td class="mdname1" valign="top" nowrap> </td>
1420 <td class="md" valign="top"> ) </td>
1421 <td class="md" nowrap><code> [virtual]</code></td>
1428 <table cellspacing=5 cellpadding=0 border=0>
1436 Returns the information of the server as returned by the /ADMIN command.
1438 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.
1440 Definition at line <a class="el" href="modules_8cpp-source.html#l00553">553</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1442 <div class="fragment"><pre>00554 {
1443 00555 <span class="keywordflow">return</span> <a class="code" href="classAdmin.html">Admin</a>(getadminname(),getadminemail(),getadminnick());
1448 <a name="a19" doxytag="Server::GetNetworkName"></a><p>
1449 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1452 <table cellpadding="0" cellspacing="0" border="0">
1454 <td class="md" nowrap valign="top"> std::string Server::GetNetworkName </td>
1455 <td class="md" valign="top">( </td>
1456 <td class="mdname1" valign="top" nowrap> </td>
1457 <td class="md" valign="top"> ) </td>
1458 <td class="md" nowrap><code> [virtual]</code></td>
1465 <table cellspacing=5 cellpadding=0 border=0>
1473 Returns the network name, global to all linked servers.
1477 Definition at line <a class="el" href="modules_8cpp-source.html#l00548">548</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1479 <div class="fragment"><pre>00549 {
1480 00550 <span class="keywordflow">return</span> getnetworkname();
1485 <a name="a18" doxytag="Server::GetServerName"></a><p>
1486 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1489 <table cellpadding="0" cellspacing="0" border="0">
1491 <td class="md" nowrap valign="top"> std::string Server::GetServerName </td>
1492 <td class="md" valign="top">( </td>
1493 <td class="mdname1" valign="top" nowrap> </td>
1494 <td class="md" valign="top"> ) </td>
1495 <td class="md" nowrap><code> [virtual]</code></td>
1502 <table cellspacing=5 cellpadding=0 border=0>
1510 Returns the server name of the server where the module is loaded.
1514 Definition at line <a class="el" href="modules_8cpp-source.html#l00543">543</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1516 <div class="fragment"><pre>00544 {
1517 00545 <span class="keywordflow">return</span> getservername();
1522 <a name="a35" doxytag="Server::GetUsers"></a><p>
1523 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1526 <table cellpadding="0" cellspacing="0" border="0">
1528 <td class="md" nowrap valign="top"> <a class="el" href="modules_8h.html#a33">chanuserlist</a> Server::GetUsers </td>
1529 <td class="md" valign="top">( </td>
1530 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
1531 <td class="mdname1" valign="top" nowrap> <em>chan</em> </td>
1532 <td class="md" valign="top"> ) </td>
1533 <td class="md" nowrap><code> [virtual]</code></td>
1540 <table cellspacing=5 cellpadding=0 border=0>
1548 Fetches the userlist of a channel.
1550 This function must be here and not a member of userrec or chanrec due to include constraints.
1552 Definition at line <a class="el" href="modules_8cpp-source.html#l00390">390</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1554 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>.
1556 <div class="fragment"><pre>00391 {
1557 00392 <a class="code" href="modules_8h.html#a33">chanuserlist</a> userl;
1558 00393 userl.clear();
1559 00394 <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++)
1561 00396 <span class="keywordflow">if</span> (i->second)
1563 00398 <span class="keywordflow">if</span> (<a class="code" href="message_8h.html#a16">has_channel</a>(i->second,chan))
1565 00400 <span class="keywordflow">if</span> (<a class="code" href="message_8h.html#a13">isnick</a>(i->second->nick))
1567 00402 userl.push_back(i->second);
1572 00407 <span class="keywordflow">return</span> userl;
1577 <a name="a12" doxytag="Server::IsNick"></a><p>
1578 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1581 <table cellpadding="0" cellspacing="0" border="0">
1583 <td class="md" nowrap valign="top"> bool Server::IsNick </td>
1584 <td class="md" valign="top">( </td>
1585 <td class="md" nowrap valign="top">std::string </td>
1586 <td class="mdname1" valign="top" nowrap> <em>nick</em> </td>
1587 <td class="md" valign="top"> ) </td>
1588 <td class="md" nowrap><code> [virtual]</code></td>
1595 <table cellspacing=5 cellpadding=0 border=0>
1603 Returns true if a nick is valid.
1605 Nicks for unregistered connections will return false.
1607 Definition at line <a class="el" href="modules_8cpp-source.html#l00518">518</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1609 References <a class="el" href="message_8h.html#a13">isnick()</a>.
1611 <div class="fragment"><pre>00519 {
1612 00520 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a13">isnick</a>(nick.c_str()) != 0);
1617 <a name="a17" doxytag="Server::IsOnChannel"></a><p>
1618 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1621 <table cellpadding="0" cellspacing="0" border="0">
1623 <td class="md" nowrap valign="top"> bool Server::IsOnChannel </td>
1624 <td class="md" valign="top">( </td>
1625 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1626 <td class="mdname" nowrap> <em>User</em>, </td>
1631 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
1632 <td class="mdname" nowrap> <em>Chan</em></td>
1636 <td class="md">) </td>
1637 <td class="md" colspan="2"><code> [virtual]</code></td>
1644 <table cellspacing=5 cellpadding=0 border=0>
1652 Checks if a user is on a channel.
1654 This function will return true or false to indicate if user 'User' is on channel 'Chan'.
1656 Definition at line <a class="el" href="modules_8cpp-source.html#l00538">538</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1658 References <a class="el" href="message_8h.html#a16">has_channel()</a>.
1660 <div class="fragment"><pre>00539 {
1661 00540 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a16">has_channel</a>(User,Chan);
1666 <a name="a34" doxytag="Server::IsUlined"></a><p>
1667 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1670 <table cellpadding="0" cellspacing="0" border="0">
1672 <td class="md" nowrap valign="top"> bool Server::IsUlined </td>
1673 <td class="md" valign="top">( </td>
1674 <td class="md" nowrap valign="top">std::string </td>
1675 <td class="mdname1" valign="top" nowrap> <em>server</em> </td>
1676 <td class="md" valign="top"> ) </td>
1677 <td class="md" nowrap><code> [virtual]</code></td>
1684 <table cellspacing=5 cellpadding=0 border=0>
1692 Returns true if the servername you give is ulined.
1694 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.
1696 Definition at line <a class="el" href="modules_8cpp-source.html#l00420">420</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1698 References <a class="el" href="commands_8h.html#a74">is_uline()</a>.
1700 <div class="fragment"><pre>00421 {
1701 00422 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a74">is_uline</a>(server.c_str());
1706 <a name="a49" doxytag="Server::IsValidMask"></a><p>
1707 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1710 <table cellpadding="0" cellspacing="0" border="0">
1712 <td class="md" nowrap valign="top"> bool Server::IsValidMask </td>
1713 <td class="md" valign="top">( </td>
1714 <td class="md" nowrap valign="top">std::string </td>
1715 <td class="mdname1" valign="top" nowrap> <em>mask</em> </td>
1716 <td class="md" valign="top"> ) </td>
1717 <td class="md" nowrap><code> [virtual]</code></td>
1724 <table cellspacing=5 cellpadding=0 border=0>
1732 Returns true if a nick!ident string is correctly formatted, false if otherwise.
1736 Definition at line <a class="el" href="modules_8cpp-source.html#l00688">688</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1738 <div class="fragment"><pre>00689 {
1739 00690 <span class="keyword">const</span> <span class="keywordtype">char</span>* dest = mask.c_str();
1740 00691 <span class="keywordflow">if</span> (strchr(dest,<span class="charliteral">'!'</span>)==0)
1741 00692 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1742 00693 <span class="keywordflow">if</span> (strchr(dest,<span class="charliteral">'@'</span>)==0)
1743 00694 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1744 00695 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1745 00696 <span class="keywordflow">if</span> (dest[i] < 32)
1746 00697 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1747 00698 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1748 00699 <span class="keywordflow">if</span> (dest[i] > 126)
1749 00700 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1750 00701 <span class="keywordtype">int</span> c = 0;
1751 00702 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1752 00703 <span class="keywordflow">if</span> (dest[i] == <span class="charliteral">'!'</span>)
1754 00705 <span class="keywordflow">if</span> (c>1)
1755 00706 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1757 00708 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++)
1758 00709 <span class="keywordflow">if</span> (dest[i] == <span class="charliteral">'@'</span>)
1760 00711 <span class="keywordflow">if</span> (c>1)
1761 00712 <span class="keywordflow">return</span> <span class="keyword">false</span>;
1763 00714 <span class="keywordflow">return</span> <span class="keyword">true</span>;
1768 <a name="a26" doxytag="Server::JoinUserToChannel"></a><p>
1769 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1772 <table cellpadding="0" cellspacing="0" border="0">
1774 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::JoinUserToChannel </td>
1775 <td class="md" valign="top">( </td>
1776 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1777 <td class="mdname" nowrap> <em>user</em>, </td>
1782 <td class="md" nowrap>std::string </td>
1783 <td class="mdname" nowrap> <em>cname</em>, </td>
1788 <td class="md" nowrap>std::string </td>
1789 <td class="mdname" nowrap> <em>key</em></td>
1793 <td class="md">) </td>
1794 <td class="md" colspan="2"><code> [virtual]</code></td>
1801 <table cellspacing=5 cellpadding=0 border=0>
1809 Forces a user to join a channel.
1811 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.
1813 Definition at line <a class="el" href="modules_8cpp-source.html#l00380">380</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1815 <div class="fragment"><pre>00381 {
1816 00382 <span class="keywordflow">return</span> add_channel(user,cname.c_str(),key.c_str(),<span class="keyword">true</span>);
1821 <a name="a3" doxytag="Server::Log"></a><p>
1822 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1825 <table cellpadding="0" cellspacing="0" border="0">
1827 <td class="md" nowrap valign="top"> void Server::Log </td>
1828 <td class="md" valign="top">( </td>
1829 <td class="md" nowrap valign="top">int </td>
1830 <td class="mdname" nowrap> <em>level</em>, </td>
1835 <td class="md" nowrap>std::string </td>
1836 <td class="mdname" nowrap> <em>s</em></td>
1840 <td class="md">) </td>
1841 <td class="md" colspan="2"><code> [virtual]</code></td>
1848 <table cellspacing=5 cellpadding=0 border=0>
1856 Writes a log string.
1858 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.
1860 Definition at line <a class="el" href="modules_8cpp-source.html#l00430">430</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1862 <div class="fragment"><pre>00431 {
1863 00432 log(level,<span class="stringliteral">"%s"</span>,s.c_str());
1868 <a name="a30" doxytag="Server::MatchText"></a><p>
1869 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1872 <table cellpadding="0" cellspacing="0" border="0">
1874 <td class="md" nowrap valign="top"> bool Server::MatchText </td>
1875 <td class="md" valign="top">( </td>
1876 <td class="md" nowrap valign="top">std::string </td>
1877 <td class="mdname" nowrap> <em>sliteral</em>, </td>
1882 <td class="md" nowrap>std::string </td>
1883 <td class="mdname" nowrap> <em>spattern</em></td>
1887 <td class="md">) </td>
1888 <td class="md" colspan="2"><code> [virtual]</code></td>
1895 <table cellspacing=5 cellpadding=0 border=0>
1903 Matches text against a glob pattern.
1905 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.
1907 Definition at line <a class="el" href="modules_8cpp-source.html#l00367">367</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1909 <div class="fragment"><pre>00368 {
1910 00369 <span class="keywordtype">char</span> literal[MAXBUF],pattern[MAXBUF];
1911 00370 strlcpy(literal,sliteral.c_str(),MAXBUF);
1912 00371 strlcpy(pattern,spattern.c_str(),MAXBUF);
1913 00372 <span class="keywordflow">return</span> match(literal,pattern);
1918 <a name="a27" doxytag="Server::PartUserFromChannel"></a><p>
1919 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1922 <table cellpadding="0" cellspacing="0" border="0">
1924 <td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::PartUserFromChannel </td>
1925 <td class="md" valign="top">( </td>
1926 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1927 <td class="mdname" nowrap> <em>user</em>, </td>
1932 <td class="md" nowrap>std::string </td>
1933 <td class="mdname" nowrap> <em>cname</em>, </td>
1938 <td class="md" nowrap>std::string </td>
1939 <td class="mdname" nowrap> <em>reason</em></td>
1943 <td class="md">) </td>
1944 <td class="md" colspan="2"><code> [virtual]</code></td>
1951 <table cellspacing=5 cellpadding=0 border=0>
1959 Forces a user to part a channel.
1961 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.
1963 Definition at line <a class="el" href="modules_8cpp-source.html#l00385">385</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1965 <div class="fragment"><pre>00386 {
1966 00387 <span class="keywordflow">return</span> del_channel(user,cname.c_str(),reason.c_str(),<span class="keyword">false</span>);
1971 <a name="a37" doxytag="Server::PseudoToUser"></a><p>
1972 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1975 <table cellpadding="0" cellspacing="0" border="0">
1977 <td class="md" nowrap valign="top"> bool Server::PseudoToUser </td>
1978 <td class="md" valign="top">( </td>
1979 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1980 <td class="mdname" nowrap> <em>alive</em>, </td>
1985 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
1986 <td class="mdname" nowrap> <em>zombie</em>, </td>
1991 <td class="md" nowrap>std::string </td>
1992 <td class="mdname" nowrap> <em>message</em></td>
1996 <td class="md">) </td>
1997 <td class="md" colspan="2"><code> [virtual]</code></td>
2004 <table cellspacing=5 cellpadding=0 border=0>
2012 This user takes one user, and switches their file descriptor with another user, so that one user "becomes" the other.
2014 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.
2016 Definition at line <a class="el" href="modules_8cpp-source.html#l00603">603</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2018 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>.
2020 <div class="fragment"><pre>00604 {
2021 00605 zombie-><a class="code" href="classconnection.html#o0">fd</a> = alive-><a class="code" href="classconnection.html#o0">fd</a>;
2022 00606 alive-><a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="modules_8h.html#a26">FD_MAGIC_NUMBER</a>;
2023 00607 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>);
2024 00608 kill_link(alive,message.c_str());
2025 00609 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i != MAXCHANS; i++)
2027 00611 <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)
2029 00613 <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>)
2031 00615 <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>;
2032 00616 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>);
2033 00617 <span class="keywordflow">if</span> (Ptr-><a class="code" href="classchanrec.html#o4">topicset</a>)
2035 00619 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>);
2036 00620 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>);
2038 00622 userlist(zombie,Ptr);
2039 00623 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>);
2040 00624 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));
2041 00625 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>);
2051 <a name="a29" doxytag="Server::QuitUser"></a><p>
2052 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2055 <table cellpadding="0" cellspacing="0" border="0">
2057 <td class="md" nowrap valign="top"> void Server::QuitUser </td>
2058 <td class="md" valign="top">( </td>
2059 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2060 <td class="mdname" nowrap> <em>user</em>, </td>
2065 <td class="md" nowrap>std::string </td>
2066 <td class="mdname" nowrap> <em>reason</em></td>
2070 <td class="md">) </td>
2071 <td class="md" colspan="2"><code> [virtual]</code></td>
2078 <table cellspacing=5 cellpadding=0 border=0>
2086 Forces a user to quit with the specified reason.
2088 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>
2090 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.
2092 Definition at line <a class="el" href="modules_8cpp-source.html#l00414">414</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2094 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>.
2096 <div class="fragment"><pre>00415 {
2097 00416 <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());
2098 00417 kill_link(user,reason.c_str());
2103 <a name="a4" doxytag="Server::Send"></a><p>
2104 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2107 <table cellpadding="0" cellspacing="0" border="0">
2109 <td class="md" nowrap valign="top"> void Server::Send </td>
2110 <td class="md" valign="top">( </td>
2111 <td class="md" nowrap valign="top">int </td>
2112 <td class="mdname" nowrap> <em>Socket</em>, </td>
2117 <td class="md" nowrap>std::string </td>
2118 <td class="mdname" nowrap> <em>s</em></td>
2122 <td class="md">) </td>
2123 <td class="md" colspan="2"><code> [virtual]</code></td>
2130 <table cellspacing=5 cellpadding=0 border=0>
2138 Sends a line of text down a TCP/IP socket.
2140 This method writes a line of text to an established socket, cutting it to 510 characters plus a carriage return and linefeed if required.
2142 Definition at line <a class="el" href="modules_8cpp-source.html#l00445">445</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2144 <div class="fragment"><pre>00446 {
2145 00447 Write(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
2150 <a name="a8" doxytag="Server::SendChannel"></a><p>
2151 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2154 <table cellpadding="0" cellspacing="0" border="0">
2156 <td class="md" nowrap valign="top"> void Server::SendChannel </td>
2157 <td class="md" valign="top">( </td>
2158 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2159 <td class="mdname" nowrap> <em>User</em>, </td>
2164 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
2165 <td class="mdname" nowrap> <em>Channel</em>, </td>
2170 <td class="md" nowrap>std::string </td>
2171 <td class="mdname" nowrap> <em>s</em>, </td>
2176 <td class="md" nowrap>bool </td>
2177 <td class="mdname" nowrap> <em>IncludeSender</em></td>
2181 <td class="md">) </td>
2182 <td class="md" colspan="2"><code> [virtual]</code></td>
2189 <table cellspacing=5 cellpadding=0 border=0>
2197 Sends text from a user to a channel (mulicast).
2199 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).
2201 Definition at line <a class="el" href="modules_8cpp-source.html#l00474">474</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2203 <div class="fragment"><pre>00475 {
2204 00476 <span class="keywordflow">if</span> (IncludeSender)
2206 00478 WriteChannel(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
2208 00480 <span class="keywordflow">else</span>
2210 00482 ChanExceptSender(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
2216 <a name="a10" doxytag="Server::SendCommon"></a><p>
2217 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2220 <table cellpadding="0" cellspacing="0" border="0">
2222 <td class="md" nowrap valign="top"> void Server::SendCommon </td>
2223 <td class="md" valign="top">( </td>
2224 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2225 <td class="mdname" nowrap> <em>User</em>, </td>
2230 <td class="md" nowrap>std::string </td>
2231 <td class="mdname" nowrap> <em>text</em>, </td>
2236 <td class="md" nowrap>bool </td>
2237 <td class="mdname" nowrap> <em>IncludeSender</em></td>
2241 <td class="md">) </td>
2242 <td class="md" colspan="2"><code> [virtual]</code></td>
2249 <table cellspacing=5 cellpadding=0 border=0>
2257 Sends text from a user to one or more channels (mulicast).
2259 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.
2261 Definition at line <a class="el" href="modules_8cpp-source.html#l00491">491</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2263 <div class="fragment"><pre>00492 {
2264 00493 <span class="keywordflow">if</span> (IncludeSender)
2266 00495 WriteCommon(User,<span class="stringliteral">"%s"</span>,text.c_str());
2268 00497 <span class="keywordflow">else</span>
2270 00499 WriteCommonExcept(User,<span class="stringliteral">"%s"</span>,text.c_str());
2276 <a name="a6" doxytag="Server::SendFrom"></a><p>
2277 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2280 <table cellpadding="0" cellspacing="0" border="0">
2282 <td class="md" nowrap valign="top"> void Server::SendFrom </td>
2283 <td class="md" valign="top">( </td>
2284 <td class="md" nowrap valign="top">int </td>
2285 <td class="mdname" nowrap> <em>Socket</em>, </td>
2290 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2291 <td class="mdname" nowrap> <em>User</em>, </td>
2296 <td class="md" nowrap>std::string </td>
2297 <td class="mdname" nowrap> <em>s</em></td>
2301 <td class="md">) </td>
2302 <td class="md" colspan="2"><code> [virtual]</code></td>
2309 <table cellspacing=5 cellpadding=0 border=0>
2317 Sends text from a user to a socket.
2319 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)
2321 Definition at line <a class="el" href="modules_8cpp-source.html#l00455">455</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2323 <div class="fragment"><pre>00456 {
2324 00457 WriteFrom(Socket,User,<span class="stringliteral">"%s"</span>,s.c_str());
2329 <a name="a24" doxytag="Server::SendMode"></a><p>
2330 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2333 <table cellpadding="0" cellspacing="0" border="0">
2335 <td class="md" nowrap valign="top"> void Server::SendMode </td>
2336 <td class="md" valign="top">( </td>
2337 <td class="md" nowrap valign="top">char ** </td>
2338 <td class="mdname" nowrap> <em>parameters</em>, </td>
2343 <td class="md" nowrap>int </td>
2344 <td class="mdname" nowrap> <em>pcnt</em>, </td>
2349 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2350 <td class="mdname" nowrap> <em>user</em></td>
2354 <td class="md">) </td>
2355 <td class="md" colspan="2"><code> [virtual]</code></td>
2362 <table cellspacing=5 cellpadding=0 border=0>
2372 you must format the parameters array with the target, modes and parameters for those modes.<p>
2375 modes[0] = ChannelName;<p>
2377 modes[2] = user->nick;<p>
2378 Srv->SendMode(modes,3,user);<p>
2379 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!
2381 Definition at line <a class="el" href="modules_8cpp-source.html#l00440">440</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2383 References <a class="el" href="modules_8h.html#a36">server_mode()</a>.
2385 <div class="fragment"><pre>00441 {
2386 00442 <a class="code" href="modules_8h.html#a36">server_mode</a>(parameters,pcnt,user);
2391 <a name="a2" doxytag="Server::SendOpers"></a><p>
2392 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2395 <table cellpadding="0" cellspacing="0" border="0">
2397 <td class="md" nowrap valign="top"> void Server::SendOpers </td>
2398 <td class="md" valign="top">( </td>
2399 <td class="md" nowrap valign="top">std::string </td>
2400 <td class="mdname1" valign="top" nowrap> <em>s</em> </td>
2401 <td class="md" valign="top"> ) </td>
2402 <td class="md" nowrap><code> [virtual]</code></td>
2409 <table cellspacing=5 cellpadding=0 border=0>
2417 Sends text to all opers.
2419 This method sends a server notice to all opers with the usermode +s.
2421 Definition at line <a class="el" href="modules_8cpp-source.html#l00362">362</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2423 <div class="fragment"><pre>00363 {
2424 00364 WriteOpers(<span class="stringliteral">"%s"</span>,s.c_str());
2429 <a name="a5" doxytag="Server::SendServ"></a><p>
2430 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2433 <table cellpadding="0" cellspacing="0" border="0">
2435 <td class="md" nowrap valign="top"> void Server::SendServ </td>
2436 <td class="md" valign="top">( </td>
2437 <td class="md" nowrap valign="top">int </td>
2438 <td class="mdname" nowrap> <em>Socket</em>, </td>
2443 <td class="md" nowrap>std::string </td>
2444 <td class="mdname" nowrap> <em>s</em></td>
2448 <td class="md">) </td>
2449 <td class="md" colspan="2"><code> [virtual]</code></td>
2456 <table cellspacing=5 cellpadding=0 border=0>
2464 Sends text from the server to a socket.
2466 This method writes a line of text to an established socket, with the servername prepended as used by numerics (see RFC 1459)
2468 Definition at line <a class="el" href="modules_8cpp-source.html#l00450">450</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2470 <div class="fragment"><pre>00451 {
2471 00452 WriteServ(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
2476 <a name="a7" doxytag="Server::SendTo"></a><p>
2477 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2480 <table cellpadding="0" cellspacing="0" border="0">
2482 <td class="md" nowrap valign="top"> void Server::SendTo </td>
2483 <td class="md" valign="top">( </td>
2484 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2485 <td class="mdname" nowrap> <em>Source</em>, </td>
2490 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
2491 <td class="mdname" nowrap> <em>Dest</em>, </td>
2496 <td class="md" nowrap>std::string </td>
2497 <td class="mdname" nowrap> <em>s</em></td>
2501 <td class="md">) </td>
2502 <td class="md" colspan="2"><code> [virtual]</code></td>
2509 <table cellspacing=5 cellpadding=0 border=0>
2517 Sends text from a user to another user.
2519 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>
2521 The format will become:<p>
2522 :localserver TEXT<p>
2523 Which is useful for numerics and server notices to single users, etc.
2525 Definition at line <a class="el" href="modules_8cpp-source.html#l00460">460</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2527 References <a class="el" href="connection_8h-source.html#l00171">connection::fd</a>.
2529 <div class="fragment"><pre>00461 {
2530 00462 <span class="keywordflow">if</span> (!Source)
2532 00464 <span class="comment">// if source is NULL, then the message originates from the local server</span>
2533 00465 Write(Dest-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">":%s %s"</span>,this->GetServerName().c_str(),s.c_str());
2535 00467 <span class="keywordflow">else</span>
2537 00469 <span class="comment">// otherwise it comes from the user specified</span>
2538 00470 WriteTo(Source,Dest,<span class="stringliteral">"%s"</span>,s.c_str());
2544 <a name="a25" doxytag="Server::SendToModeMask"></a><p>
2545 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2548 <table cellpadding="0" cellspacing="0" border="0">
2550 <td class="md" nowrap valign="top"> void Server::SendToModeMask </td>
2551 <td class="md" valign="top">( </td>
2552 <td class="md" nowrap valign="top">std::string </td>
2553 <td class="mdname" nowrap> <em>modes</em>, </td>
2558 <td class="md" nowrap>int </td>
2559 <td class="mdname" nowrap> <em>flags</em>, </td>
2564 <td class="md" nowrap>std::string </td>
2565 <td class="mdname" nowrap> <em>text</em></td>
2569 <td class="md">) </td>
2570 <td class="md" colspan="2"><code> [virtual]</code></td>
2577 <table cellspacing=5 cellpadding=0 border=0>
2585 Sends to all users matching a mode mask You must specify one or more usermodes as the first parameter.
2587 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>
2588 Serv->SendToModeMask("xi", WM_OR, "m00");<p>
2589 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.
2591 Definition at line <a class="el" href="modules_8cpp-source.html#l00375">375</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2593 <div class="fragment"><pre>00376 {
2594 00377 WriteMode(modes.c_str(),flags,<span class="stringliteral">"%s"</span>,text.c_str());
2599 <a name="a11" doxytag="Server::SendWallops"></a><p>
2600 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2603 <table cellpadding="0" cellspacing="0" border="0">
2605 <td class="md" nowrap valign="top"> void Server::SendWallops </td>
2606 <td class="md" valign="top">( </td>
2607 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2608 <td class="mdname" nowrap> <em>User</em>, </td>
2613 <td class="md" nowrap>std::string </td>
2614 <td class="mdname" nowrap> <em>text</em></td>
2618 <td class="md">) </td>
2619 <td class="md" colspan="2"><code> [virtual]</code></td>
2626 <table cellspacing=5 cellpadding=0 border=0>
2634 Sends a WALLOPS message.
2636 This method writes a WALLOPS message to all users with the +w flag, originating from the specified user.
2638 Definition at line <a class="el" href="modules_8cpp-source.html#l00503">503</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2640 <div class="fragment"><pre>00504 {
2641 00505 WriteWallOps(User,<span class="keyword">false</span>,<span class="stringliteral">"%s"</span>,text.c_str());
2646 <a name="a36" doxytag="Server::UserToPseudo"></a><p>
2647 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2650 <table cellpadding="0" cellspacing="0" border="0">
2652 <td class="md" nowrap valign="top"> bool Server::UserToPseudo </td>
2653 <td class="md" valign="top">( </td>
2654 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
2655 <td class="mdname" nowrap> <em>user</em>, </td>
2660 <td class="md" nowrap>std::string </td>
2661 <td class="mdname" nowrap> <em>message</em></td>
2665 <td class="md">) </td>
2666 <td class="md" colspan="2"><code> [virtual]</code></td>
2673 <table cellspacing=5 cellpadding=0 border=0>
2681 Remove a user's connection to the irc server, but leave their client in existence in the user hash.
2683 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.
2685 Definition at line <a class="el" href="modules_8cpp-source.html#l00594">594</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
2687 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>.
2689 <div class="fragment"><pre>00595 {
2690 00596 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> old_fd = user-><a class="code" href="classconnection.html#o0">fd</a>;
2691 00597 user-><a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="modules_8h.html#a26">FD_MAGIC_NUMBER</a>;
2692 00598 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());
2693 00599 close(old_fd);
2694 00600 shutdown (old_fd,2);
2699 <hr>The documentation for this class was generated from the following files:<ul>
2700 <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>
2701 <hr size="1"><address style="align: right;"><small>Generated on Sat Apr 16 14:49:54 2005 for InspIRCd by
2702 <a href="http://www.doxygen.org/index.html">
2703 <img src="doxygen.png" alt="doxygen" align="middle" border=0 >
2704 </a>1.3.3 </small></address>