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: userrec 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>userrec Class Reference</h1>Holds all information about a user This class stores all information about a user connected to the irc server.
9 <a href="#_details">More...</a>
11 <code>#include <<a class="el" href="users_8h-source.html">users.h</a>></code>
13 Inherits <a class="el" href="classconnection.html">connection</a>.
15 <a href="classuserrec-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="classuserrec.html#a0">userrec</a> ()</td></tr>
20 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a1">~userrec</a> ()</td></tr>
22 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual char * </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a2">GetFullHost</a> ()</td></tr>
24 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the full displayed host of the user This member function returns the hostname of the user as seen by other users on the server, in nick!identhost form. </em> <a href="#a2"></a><em><br><br></td></tr>
25 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual char * </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a3">GetFullRealHost</a> ()</td></tr>
27 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the full real host of the user This member function returns the hostname of the user as seen by other users on the server, in nick!identhost form. </em> <a href="#a3"></a><em><br><br></td></tr>
28 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a4">IsInvited</a> (char *channel)</td></tr>
30 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns true if a user is invited to a channel. </em> <a href="#a4"></a><em><br><br></td></tr>
31 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a5">InviteTo</a> (char *channel)</td></tr>
33 <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a channel to a users invite list (invites them to a channel). </em> <a href="#a5"></a><em><br><br></td></tr>
34 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a6">RemoveInvite</a> (char *channel)</td></tr>
36 <tr><td class="mdescLeft"> </td><td class="mdescRight">Removes a channel from a users invite list. </em> <a href="#a6"></a><em><br><br></td></tr>
37 <tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a7">HasPermission</a> (char *command)</td></tr>
39 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns true or false for if a user can execute a privilaged oper command. </em> <a href="#a7"></a><em><br><br></td></tr>
40 <tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a8">AddBuffer</a> (std::string a)</td></tr>
42 <tr><td class="mdescLeft"> </td><td class="mdescRight">This method adds data to the buffer of the user. </em> <a href="#a8"></a><em><br><br></td></tr>
43 <tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a9">BufferIsReady</a> ()</td></tr>
45 <tr><td class="mdescLeft"> </td><td class="mdescRight">This method returns true if the buffer contains at least one carriage return character (e.g. </em> <a href="#a9"></a><em><br><br></td></tr>
46 <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a10">ClearBuffer</a> ()</td></tr>
48 <tr><td class="mdescLeft"> </td><td class="mdescRight">This function clears the entire buffer by setting it to an empty string. </em> <a href="#a10"></a><em><br><br></td></tr>
49 <tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a11">GetBuffer</a> ()</td></tr>
51 <tr><td class="mdescLeft"> </td><td class="mdescRight">This method returns the first available string at the tail end of the buffer and advances the tail end of the buffer past the string. </em> <a href="#a11"></a><em><br><br></td></tr>
52 <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a12">SetWriteError</a> (std::string error)</td></tr>
54 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the write error for a connection. </em> <a href="#a12"></a><em><br><br></td></tr>
55 <tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a13">GetWriteError</a> ()</td></tr>
57 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the write error which last occured on this connection or an empty string if none occured. </em> <a href="#a13"></a><em><br><br></td></tr>
58 <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a14">AddWriteBuf</a> (std::string data)</td></tr>
60 <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds to the user's write buffer. </em> <a href="#a14"></a><em><br><br></td></tr>
61 <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a15">FlushWriteBuf</a> ()</td></tr>
63 <tr><td class="mdescLeft"> </td><td class="mdescRight">Flushes as much of the user's buffer to the file descriptor as possible. </em> <a href="#a15"></a><em><br><br></td></tr>
64 <tr><td colspan=2><br><h2>Public Attributes</h2></td></tr>
65 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o0">nick</a> [NICKMAX]</td></tr>
67 <tr><td class="mdescLeft"> </td><td class="mdescRight">The users nickname. </em> <a href="#o0"></a><em><br><br></td></tr>
68 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o1">ident</a> [64]</td></tr>
70 <tr><td class="mdescLeft"> </td><td class="mdescRight">The users ident reply. </em> <a href="#o1"></a><em><br><br></td></tr>
71 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o2">dhost</a> [256]</td></tr>
73 <tr><td class="mdescLeft"> </td><td class="mdescRight">The host displayed to non-opers (used for cloaking etc). </em> <a href="#o2"></a><em><br><br></td></tr>
74 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o3">fullname</a> [128]</td></tr>
76 <tr><td class="mdescLeft"> </td><td class="mdescRight">The users full name. </em> <a href="#o3"></a><em><br><br></td></tr>
77 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o4">modes</a> [MAXBUF]</td></tr>
79 <tr><td class="mdescLeft"> </td><td class="mdescRight">The user's mode string. </em> <a href="#o4"></a><em><br><br></td></tr>
80 <tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="classucrec.html">ucrec</a> </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o5">chans</a> [MAXCHANS]</td></tr>
82 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o6">server</a> [256]</td></tr>
84 <tr><td class="mdescLeft"> </td><td class="mdescRight">The server the user is connected to. </em> <a href="#o6"></a><em><br><br></td></tr>
85 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o7">awaymsg</a> [512]</td></tr>
87 <tr><td class="mdescLeft"> </td><td class="mdescRight">The user's away message. </em> <a href="#o7"></a><em><br><br></td></tr>
88 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o8">result</a> [256]</td></tr>
90 <tr><td class="mdescLeft"> </td><td class="mdescRight">Stores the result of the last GetFullHost or GetRealHost call. </em> <a href="#o8"></a><em><br><br></td></tr>
91 <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o9">flood</a></td></tr>
93 <tr><td class="mdescLeft"> </td><td class="mdescRight">Number of lines the user can place into the buffer (up to the global NetBufferSize bytes) before they are disconnected for excess flood. </em> <a href="#o9"></a><em><br><br></td></tr>
94 <tr><td class="memItemLeft" nowrap align=right valign=top>unsigned long </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o10">timeout</a></td></tr>
96 <tr><td class="mdescLeft"> </td><td class="mdescRight">Number of seconds this user is given to send USER/NICK If they do not send their details in this time limit they will be disconnected. </em> <a href="#o10"></a><em><br><br></td></tr>
97 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o11">oper</a> [NICKMAX]</td></tr>
99 <tr><td class="mdescLeft"> </td><td class="mdescRight">The oper type they logged in as, if they are an oper. </em> <a href="#o11"></a><em><br><br></td></tr>
100 <tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o12">dns_done</a></td></tr>
102 <tr><td class="mdescLeft"> </td><td class="mdescRight">True when <a class="el" href="classDNS.html">DNS</a> lookups are completed. </em> <a href="#o12"></a><em><br><br></td></tr>
103 <tr><td class="memItemLeft" nowrap align=right valign=top>unsigned long </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o13">pingmax</a></td></tr>
105 <tr><td class="mdescLeft"> </td><td class="mdescRight">Number of seconds between PINGs for this user (set from <connect:allow> tag. </em> <a href="#o13"></a><em><br><br></td></tr>
106 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o14">password</a> [MAXBUF]</td></tr>
108 <tr><td class="mdescLeft"> </td><td class="mdescRight">Password specified by the user when they registered. </em> <a href="#o14"></a><em><br><br></td></tr>
109 <tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o15">recvq</a></td></tr>
111 <tr><td class="mdescLeft"> </td><td class="mdescRight">User's receive queue. </em> <a href="#o15"></a><em><br><br></td></tr>
112 <tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o16">sendq</a></td></tr>
114 <tr><td class="mdescLeft"> </td><td class="mdescRight">User's send queue. </em> <a href="#o16"></a><em><br><br></td></tr>
115 <tr><td class="memItemLeft" nowrap align=right valign=top>long </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o17">lines_in</a></td></tr>
117 <tr><td class="mdescLeft"> </td><td class="mdescRight">Flood counters. </em> <a href="#o17"></a><em><br><br></td></tr>
118 <tr><td class="memItemLeft" nowrap align=right valign=top>time_t </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o18">reset_due</a></td></tr>
120 <tr><td class="memItemLeft" nowrap align=right valign=top>long </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o19">threshold</a></td></tr>
122 <tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o20">WriteError</a></td></tr>
124 <tr><td class="memItemLeft" nowrap align=right valign=top>long </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o21">sendqmax</a></td></tr>
126 <tr><td class="mdescLeft"> </td><td class="mdescRight">Maximum size this user's sendq can become. </em> <a href="#o21"></a><em><br><br></td></tr>
127 <tr><td class="memItemLeft" nowrap align=right valign=top>long </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o22">recvqmax</a></td></tr>
129 <tr><td class="mdescLeft"> </td><td class="mdescRight">Maximum size this user's recvq can become. </em> <a href="#o22"></a><em><br><br></td></tr>
130 <tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
131 <tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="users_8h.html#a6">InvitedList</a> </td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#r0">invites</a></td></tr>
133 <tr><td class="mdescLeft"> </td><td class="mdescRight">A list of channels the user has a pending invite to. </em> <a href="#r0"></a><em><br><br></td></tr>
135 <hr><a name="_details"></a><h2>Detailed Description</h2>
136 Holds all information about a user This class stores all information about a user connected to the irc server.
138 Everything about a connection is stored here primarily, from the user's socket ID (file descriptor) through to the user's nickname and hostname. Use the Find method of the server class to locate a specific user by nickname.
142 Definition at line <a class="el" href="users_8h-source.html#l00108">108</a> of file <a class="el" href="users_8h-source.html">users.h</a>.<hr><h2>Constructor & Destructor Documentation</h2>
143 <a name="a0" doxytag="userrec::userrec"></a><p>
144 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
147 <table cellpadding="0" cellspacing="0" border="0">
149 <td class="md" nowrap valign="top"> userrec::userrec </td>
150 <td class="md" valign="top">( </td>
151 <td class="mdname1" valign="top" nowrap> </td>
152 <td class="md" valign="top"> ) </td>
153 <td class="md" nowrap></td>
160 <table cellspacing=5 cellpadding=0 border=0>
170 Definition at line <a class="el" href="users_8cpp-source.html#l00028">28</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
172 References <a class="el" href="users_8h-source.html#l00151">awaymsg</a>, <a class="el" href="connection_8h-source.html#l00231">connection::bytes_in</a>, <a class="el" href="connection_8h-source.html#l00235">connection::bytes_out</a>, <a class="el" href="channels_8h-source.html#l00268">ucrec::channel</a>, <a class="el" href="users_8h-source.html#l00142">chans</a>, <a class="el" href="connection_8h-source.html#l00239">connection::cmds_in</a>, <a class="el" href="connection_8h-source.html#l00243">connection::cmds_out</a>, <a class="el" href="users_8h-source.html#l00130">dhost</a>, <a class="el" href="users_8h-source.html#l00179">dns_done</a>, <a class="el" href="connection_8h-source.html#l00215">connection::fd</a>, <a class="el" href="users_8h-source.html#l00162">flood</a>, <a class="el" href="users_8h-source.html#l00134">fullname</a>, <a class="el" href="connection_8h-source.html#l00247">connection::haspassed</a>, <a class="el" href="connection_8h-source.html#l00219">connection::host</a>, <a class="el" href="users_8h-source.html#l00125">ident</a>, <a class="el" href="connection_8h-source.html#l00273">connection::idle_lastmsg</a>, <a class="el" href="connection_8h-source.html#l00227">connection::inbuf</a>, <a class="el" href="users_8h-source.html#l00114">invites</a>, <a class="el" href="connection_8h-source.html#l00223">connection::ip</a>, <a class="el" href="connection_8h-source.html#l00265">connection::lastping</a>, <a class="el" href="users_8h-source.html#l00204">lines_in</a>, <a class="el" href="users_8h-source.html#l00140">modes</a>, <a class="el" href="users_8h-source.html#l00121">nick</a>, <a class="el" href="connection_8h-source.html#l00277">connection::nping</a>, <a class="el" href="users_8h-source.html#l00175">oper</a>, <a class="el" href="connection_8h-source.html#l00253">connection::port</a>, <a class="el" href="users_8h-source.html#l00195">recvq</a>, <a class="el" href="connection_8h-source.html#l00257">connection::registered</a>, <a class="el" href="users_8h-source.html#l00205">reset_due</a>, <a class="el" href="users_8h-source.html#l00156">result</a>, <a class="el" href="users_8h-source.html#l00200">sendq</a>, <a class="el" href="users_8h-source.html#l00146">server</a>, <a class="el" href="connection_8h-source.html#l00269">connection::signon</a>, <a class="el" href="channels_8cpp-source.html#l00107">TIME</a>, <a class="el" href="users_8h-source.html#l00168">timeout</a>, and <a class="el" href="channels_8h-source.html#l00263">ucrec::uc_modes</a>.
174 <div class="fragment"><pre>00029 {
175 00030 <span class="comment">// the PROPER way to do it, AVOID bzero at *ALL* costs</span>
176 00031 strcpy(nick,<span class="stringliteral">""</span>);
177 00032 strcpy(ip,<span class="stringliteral">"127.0.0.1"</span>);
178 00033 <a class="code" href="classuserrec.html#o10">timeout</a> = 0;
179 00034 strcpy(ident,<span class="stringliteral">""</span>);
180 00035 strcpy(host,<span class="stringliteral">""</span>);
181 00036 strcpy(dhost,<span class="stringliteral">""</span>);
182 00037 strcpy(fullname,<span class="stringliteral">""</span>);
183 00038 strcpy(modes,<span class="stringliteral">""</span>);
184 00039 strcpy(inbuf,<span class="stringliteral">""</span>);
185 00040 strcpy(server,<span class="stringliteral">""</span>);
186 00041 strcpy(awaymsg,<span class="stringliteral">""</span>);
187 00042 strcpy(oper,<span class="stringliteral">""</span>);
188 00043 <a class="code" href="classuserrec.html#o18">reset_due</a> = <a class="code" href="channels_8cpp.html#a37">TIME</a>;
189 00044 <a class="code" href="classuserrec.html#o17">lines_in</a> = 0;
190 00045 <a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="classconnection.html#o12">lastping</a> = <a class="code" href="classconnection.html#o13">signon</a> = <a class="code" href="classconnection.html#o14">idle_lastmsg</a> = <a class="code" href="classconnection.html#o15">nping</a> = <a class="code" href="classconnection.html#o10">registered</a> = 0;
191 00046 <a class="code" href="classuserrec.html#o9">flood</a> = <a class="code" href="classconnection.html#o9">port</a> = <a class="code" href="classconnection.html#o4">bytes_in</a> = <a class="code" href="classconnection.html#o5">bytes_out</a> = <a class="code" href="classconnection.html#o6">cmds_in</a> = <a class="code" href="classconnection.html#o7">cmds_out</a> = 0;
192 00047 <a class="code" href="classconnection.html#o8">haspassed</a> = <span class="keyword">false</span>;
193 00048 <a class="code" href="classuserrec.html#o12">dns_done</a> = <span class="keyword">false</span>;
194 00049 <a class="code" href="classuserrec.html#o15">recvq</a> = <span class="stringliteral">""</span>;
195 00050 <a class="code" href="classuserrec.html#o16">sendq</a> = <span class="stringliteral">""</span>;
196 00051 strcpy(result,<span class="stringliteral">""</span>);
197 00052 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < MAXCHANS; i++)
199 00054 this-><a class="code" href="classuserrec.html#o5">chans</a>[i].<a class="code" href="classucrec.html#o1">channel</a> = NULL;
200 00055 this-><a class="code" href="classuserrec.html#o5">chans</a>[i].<a class="code" href="classucrec.html#o0">uc_modes</a> = 0;
202 00057 <a class="code" href="classuserrec.html#r0">invites</a>.clear();
207 <a name="a1" doxytag="userrec::~userrec"></a><p>
208 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
211 <table cellpadding="0" cellspacing="0" border="0">
213 <td class="md" nowrap valign="top"> virtual userrec::~<a class="el" href="classuserrec.html">userrec</a> </td>
214 <td class="md" valign="top">( </td>
215 <td class="mdname1" valign="top" nowrap> </td>
216 <td class="md" valign="top"> ) </td>
217 <td class="md" nowrap><code> [inline, virtual]</code></td>
224 <table cellspacing=5 cellpadding=0 border=0>
234 Definition at line <a class="el" href="users_8h-source.html#l00222">222</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
236 <div class="fragment"><pre>00222 { }
240 <hr><h2>Member Function Documentation</h2>
241 <a name="a8" doxytag="userrec::AddBuffer"></a><p>
242 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
245 <table cellpadding="0" cellspacing="0" border="0">
247 <td class="md" nowrap valign="top"> bool userrec::AddBuffer </td>
248 <td class="md" valign="top">( </td>
249 <td class="md" nowrap valign="top">std::string </td>
250 <td class="mdname1" valign="top" nowrap> <em>a</em> </td>
251 <td class="md" valign="top"> ) </td>
252 <td class="md" nowrap></td>
259 <table cellspacing=5 cellpadding=0 border=0>
267 This method adds data to the buffer of the user.
269 The buffer can grow to any size within limits of the available memory, managed by the size of a std::string, however if any individual line in the buffer grows over 600 bytes in length (which is 88 chars over the RFC-specified limit per line) then the method will return false and the text will not be inserted.
271 Definition at line <a class="el" href="users_8cpp-source.html#l00170">170</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
273 References <a class="el" href="users_8h-source.html#l00195">recvq</a>, <a class="el" href="users_8h-source.html#l00218">recvqmax</a>, and <a class="el" href="users_8cpp-source.html#l00264">SetWriteError()</a>.
275 <div class="fragment"><pre>00171 {
276 00172 std::string b = <span class="stringliteral">""</span>;
277 00173 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < a.length(); i++)
278 00174 <span class="keywordflow">if</span> ((a[i] != <span class="charliteral">'\r'</span>) && (a[i] != <span class="charliteral">'\0'</span>) && (a[i] != 7))
280 00176 std::stringstream stream(recvq);
281 00177 stream << b;
282 00178 <a class="code" href="classuserrec.html#o15">recvq</a> = stream.str();
283 00179 <span class="keywordtype">int</span> i = 0;
284 00180 <span class="comment">// count the size of the first line in the buffer.</span>
285 00181 <span class="keywordflow">while</span> (i < <a class="code" href="classuserrec.html#o15">recvq</a>.length())
287 00183 <span class="keywordflow">if</span> (<a class="code" href="classuserrec.html#o15">recvq</a>[i++] == <span class="charliteral">'\n'</span>)
288 00184 <span class="keywordflow">break</span>;
290 00186 <span class="keywordflow">if</span> (<a class="code" href="classuserrec.html#o15">recvq</a>.length() > this-><a class="code" href="classuserrec.html#o22">recvqmax</a>)
292 00188 this-><a class="code" href="classuserrec.html#a12">SetWriteError</a>(<span class="stringliteral">"RecvQ exceeded"</span>);
293 00189 WriteOpers(<span class="stringliteral">"*** User %s RecvQ of %d exceeds connect class maximum of %d"</span>,this->nick,<a class="code" href="classuserrec.html#o15">recvq</a>.length(),this-><a class="code" href="classuserrec.html#o22">recvqmax</a>);
295 00191 <span class="comment">// return false if we've had more than 600 characters WITHOUT</span>
296 00192 <span class="comment">// a carriage return (this is BAD, drop the socket)</span>
297 00193 <span class="keywordflow">return</span> (i < 600);
302 <a name="a14" doxytag="userrec::AddWriteBuf"></a><p>
303 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
306 <table cellpadding="0" cellspacing="0" border="0">
308 <td class="md" nowrap valign="top"> void userrec::AddWriteBuf </td>
309 <td class="md" valign="top">( </td>
310 <td class="md" nowrap valign="top">std::string </td>
311 <td class="mdname1" valign="top" nowrap> <em>data</em> </td>
312 <td class="md" valign="top"> ) </td>
313 <td class="md" nowrap></td>
320 <table cellspacing=5 cellpadding=0 border=0>
328 Adds to the user's write buffer.
330 You may add any amount of text up to this users sendq value, if you exceed the sendq value, <a class="el" href="classuserrec.html#a12">SetWriteError()</a> will be called to set the users error string to "SendQ exceeded", and further buffer adds will be dropped.
332 Definition at line <a class="el" href="users_8cpp-source.html#l00226">226</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
334 References <a class="el" href="users_8cpp-source.html#l00272">GetWriteError()</a>, <a class="el" href="users_8h-source.html#l00200">sendq</a>, <a class="el" href="users_8h-source.html#l00214">sendqmax</a>, and <a class="el" href="users_8cpp-source.html#l00264">SetWriteError()</a>.
336 <div class="fragment"><pre>00227 {
337 00228 <span class="keywordflow">if</span> (this-><a class="code" href="classuserrec.html#a13">GetWriteError</a>() != <span class="stringliteral">""</span>)
338 00229 <span class="keywordflow">return</span>;
339 00230 <span class="keywordflow">if</span> (<a class="code" href="classuserrec.html#o16">sendq</a>.length() + data.length() > this-><a class="code" href="classuserrec.html#o21">sendqmax</a>)
341 00232 WriteOpers(<span class="stringliteral">"*** User %s SendQ of %d exceeds connect class maximum of %d"</span>,this->nick,<a class="code" href="classuserrec.html#o16">sendq</a>.length() + data.length(),this-><a class="code" href="classuserrec.html#o21">sendqmax</a>);
342 00233 this-><a class="code" href="classuserrec.html#a12">SetWriteError</a>(<span class="stringliteral">"SendQ exceeded"</span>);
343 00234 <span class="keywordflow">return</span>;
345 00236 std::stringstream stream;
346 00237 stream << <a class="code" href="classuserrec.html#o16">sendq</a> << data;
347 00238 <a class="code" href="classuserrec.html#o16">sendq</a> = stream.str();
352 <a name="a9" doxytag="userrec::BufferIsReady"></a><p>
353 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
356 <table cellpadding="0" cellspacing="0" border="0">
358 <td class="md" nowrap valign="top"> bool userrec::BufferIsReady </td>
359 <td class="md" valign="top">( </td>
360 <td class="mdname1" valign="top" nowrap> </td>
361 <td class="md" valign="top"> ) </td>
362 <td class="md" nowrap></td>
369 <table cellspacing=5 cellpadding=0 border=0>
377 This method returns true if the buffer contains at least one carriage return character (e.g.
379 one complete line may be read)
381 Definition at line <a class="el" href="users_8cpp-source.html#l00196">196</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
383 References <a class="el" href="users_8h-source.html#l00195">recvq</a>.
385 <div class="fragment"><pre>00197 {
386 00198 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < <a class="code" href="classuserrec.html#o15">recvq</a>.length(); i++)
387 00199 <span class="keywordflow">if</span> (<a class="code" href="classuserrec.html#o15">recvq</a>[i] == <span class="charliteral">'\n'</span>)
388 00200 <span class="keywordflow">return</span> <span class="keyword">true</span>;
389 00201 <span class="keywordflow">return</span> <span class="keyword">false</span>;
394 <a name="a10" doxytag="userrec::ClearBuffer"></a><p>
395 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
398 <table cellpadding="0" cellspacing="0" border="0">
400 <td class="md" nowrap valign="top"> void userrec::ClearBuffer </td>
401 <td class="md" valign="top">( </td>
402 <td class="mdname1" valign="top" nowrap> </td>
403 <td class="md" valign="top"> ) </td>
404 <td class="md" nowrap></td>
411 <table cellspacing=5 cellpadding=0 border=0>
419 This function clears the entire buffer by setting it to an empty string.
423 Definition at line <a class="el" href="users_8cpp-source.html#l00204">204</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
425 References <a class="el" href="users_8h-source.html#l00195">recvq</a>.
427 Referenced by <a class="el" href="modules_8cpp-source.html#l00699">Server::PseudoToUser()</a>, and <a class="el" href="modules_8cpp-source.html#l00680">Server::UserToPseudo()</a>.
429 <div class="fragment"><pre>00205 {
430 00206 <a class="code" href="classuserrec.html#o15">recvq</a> = <span class="stringliteral">""</span>;
435 <a name="a15" doxytag="userrec::FlushWriteBuf"></a><p>
436 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
439 <table cellpadding="0" cellspacing="0" border="0">
441 <td class="md" nowrap valign="top"> void userrec::FlushWriteBuf </td>
442 <td class="md" valign="top">( </td>
443 <td class="mdname1" valign="top" nowrap> </td>
444 <td class="md" valign="top"> ) </td>
445 <td class="md" nowrap></td>
452 <table cellspacing=5 cellpadding=0 border=0>
460 Flushes as much of the user's buffer to the file descriptor as possible.
462 This function may not always flush the entire buffer, rather instead as much of it as it possibly can. If the send() call fails to send the entire buffer, the buffer position is advanced forwards and the rest of the data sent at the next call to this method.
464 Definition at line <a class="el" href="users_8cpp-source.html#l00242">242</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
466 References <a class="el" href="connection_8h-source.html#l00235">connection::bytes_out</a>, <a class="el" href="connection_8h-source.html#l00243">connection::cmds_out</a>, <a class="el" href="users_8h-source.html#l00200">sendq</a>, and <a class="el" href="users_8cpp-source.html#l00264">SetWriteError()</a>.
468 <div class="fragment"><pre>00243 {
469 00244 <span class="keywordflow">if</span> (<a class="code" href="classuserrec.html#o16">sendq</a>.length())
471 00246 <span class="keywordtype">char</span>* tb = (<span class="keywordtype">char</span>*)this-><a class="code" href="classuserrec.html#o16">sendq</a>.c_str();
472 00247 <span class="keywordtype">int</span> n_sent = write(this->fd,tb,this->sendq.length());
473 00248 <span class="keywordflow">if</span> (n_sent == -1)
475 00250 this-><a class="code" href="classuserrec.html#a12">SetWriteError</a>(strerror(errno));
477 00252 <span class="keywordflow">else</span>
479 00254 <span class="comment">// advance the queue</span>
481 00256 this-><a class="code" href="classuserrec.html#o16">sendq</a> = tb;
482 00257 <span class="comment">// update the user's stats counters</span>
483 00258 this-><a class="code" href="classconnection.html#o5">bytes_out</a> += n_sent;
484 00259 this-><a class="code" href="classconnection.html#o7">cmds_out</a>++;
491 <a name="a11" doxytag="userrec::GetBuffer"></a><p>
492 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
495 <table cellpadding="0" cellspacing="0" border="0">
497 <td class="md" nowrap valign="top"> std::string userrec::GetBuffer </td>
498 <td class="md" valign="top">( </td>
499 <td class="mdname1" valign="top" nowrap> </td>
500 <td class="md" valign="top"> ) </td>
501 <td class="md" nowrap></td>
508 <table cellspacing=5 cellpadding=0 border=0>
516 This method returns the first available string at the tail end of the buffer and advances the tail end of the buffer past the string.
518 This means it is a one way operation in a similar way to strtok(), and multiple calls return multiple lines if they are available. The results of this function if there are no lines to be read are unknown, always use <a class="el" href="classuserrec.html#a9">BufferIsReady()</a> to check if it is ok to read the buffer before calling <a class="el" href="classuserrec.html#a11">GetBuffer()</a>.
520 Definition at line <a class="el" href="users_8cpp-source.html#l00209">209</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
522 References <a class="el" href="users_8h-source.html#l00195">recvq</a>.
524 <div class="fragment"><pre>00210 {
525 00211 <span class="keywordflow">if</span> (<a class="code" href="classuserrec.html#o15">recvq</a> == <span class="stringliteral">""</span>)
526 00212 <span class="keywordflow">return</span> <span class="stringliteral">""</span>;
527 00213 <span class="keywordtype">char</span>* line = (<span class="keywordtype">char</span>*)<a class="code" href="classuserrec.html#o15">recvq</a>.c_str();
528 00214 std::string ret = <span class="stringliteral">""</span>;
529 00215 <span class="keywordflow">while</span> ((*line != <span class="charliteral">'\n'</span>) && (strlen(line)))
531 00217 ret = ret + *line;
534 00220 <span class="keywordflow">if</span> ((*line == <span class="charliteral">'\n'</span>) || (*line == <span class="charliteral">'\r'</span>))
536 00222 <a class="code" href="classuserrec.html#o15">recvq</a> = line;
537 00223 <span class="keywordflow">return</span> ret;
542 <a name="a2" doxytag="userrec::GetFullHost"></a><p>
543 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
546 <table cellpadding="0" cellspacing="0" border="0">
548 <td class="md" nowrap valign="top"> char * userrec::GetFullHost </td>
549 <td class="md" valign="top">( </td>
550 <td class="mdname1" valign="top" nowrap> </td>
551 <td class="md" valign="top"> ) </td>
552 <td class="md" nowrap><code> [virtual]</code></td>
559 <table cellspacing=5 cellpadding=0 border=0>
567 Returns the full displayed host of the user This member function returns the hostname of the user as seen by other users on the server, in nick!identhost form.
571 Definition at line <a class="el" href="users_8cpp-source.html#l00062">62</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
573 References <a class="el" href="users_8h-source.html#l00130">dhost</a>, <a class="el" href="users_8h-source.html#l00125">ident</a>, <a class="el" href="users_8h-source.html#l00121">nick</a>, and <a class="el" href="users_8h-source.html#l00156">result</a>.
575 <div class="fragment"><pre>00063 {
576 00064 snprintf(result,MAXBUF,<span class="stringliteral">"%s!%s@%s"</span>,nick,ident,dhost);
577 00065 <span class="keywordflow">return</span> <a class="code" href="classuserrec.html#o8">result</a>;
582 <a name="a3" doxytag="userrec::GetFullRealHost"></a><p>
583 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
586 <table cellpadding="0" cellspacing="0" border="0">
588 <td class="md" nowrap valign="top"> char * userrec::GetFullRealHost </td>
589 <td class="md" valign="top">( </td>
590 <td class="mdname1" valign="top" nowrap> </td>
591 <td class="md" valign="top"> ) </td>
592 <td class="md" nowrap><code> [virtual]</code></td>
599 <table cellspacing=5 cellpadding=0 border=0>
607 Returns the full real host of the user This member function returns the hostname of the user as seen by other users on the server, in nick!identhost form.
609 If any form of hostname cloaking is in operation, e.g. through a module, then this method will ignore it and return the true hostname.
611 Definition at line <a class="el" href="users_8cpp-source.html#l00069">69</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
613 References <a class="el" href="connection_8h-source.html#l00219">connection::host</a>, <a class="el" href="users_8h-source.html#l00125">ident</a>, <a class="el" href="users_8h-source.html#l00121">nick</a>, and <a class="el" href="users_8h-source.html#l00156">result</a>.
615 <div class="fragment"><pre>00070 {
616 00071 snprintf(result,MAXBUF,<span class="stringliteral">"%s!%s@%s"</span>,nick,ident,host);
617 00072 <span class="keywordflow">return</span> <a class="code" href="classuserrec.html#o8">result</a>;
622 <a name="a13" doxytag="userrec::GetWriteError"></a><p>
623 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
626 <table cellpadding="0" cellspacing="0" border="0">
628 <td class="md" nowrap valign="top"> std::string userrec::GetWriteError </td>
629 <td class="md" valign="top">( </td>
630 <td class="mdname1" valign="top" nowrap> </td>
631 <td class="md" valign="top"> ) </td>
632 <td class="md" nowrap></td>
639 <table cellspacing=5 cellpadding=0 border=0>
647 Returns the write error which last occured on this connection or an empty string if none occured.
651 Definition at line <a class="el" href="users_8cpp-source.html#l00272">272</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
653 References <a class="el" href="users_8h-source.html#l00210">WriteError</a>.
655 Referenced by <a class="el" href="users_8cpp-source.html#l00226">AddWriteBuf()</a>.
657 <div class="fragment"><pre>00273 {
658 00274 <span class="keywordflow">return</span> this-><a class="code" href="classuserrec.html#o20">WriteError</a>;
663 <a name="a7" doxytag="userrec::HasPermission"></a><p>
664 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
667 <table cellpadding="0" cellspacing="0" border="0">
669 <td class="md" nowrap valign="top"> bool userrec::HasPermission </td>
670 <td class="md" valign="top">( </td>
671 <td class="md" nowrap valign="top">char * </td>
672 <td class="mdname1" valign="top" nowrap> <em>command</em> </td>
673 <td class="md" valign="top"> ) </td>
674 <td class="md" nowrap></td>
681 <table cellspacing=5 cellpadding=0 border=0>
689 Returns true or false for if a user can execute a privilaged oper command.
691 This is done by looking up their oper type from <a class="el" href="classuserrec.html#o11">userrec::oper</a>, then referencing this to their oper classes and checking the commands they can execute.
693 Definition at line <a class="el" href="users_8cpp-source.html#l00118">118</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
695 References <a class="el" href="channels_8cpp-source.html#l00101">config_f</a>, and <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>.
697 <div class="fragment"><pre>00119 {
698 00120 <span class="keywordtype">char</span> TypeName[MAXBUF],Classes[MAXBUF],ClassName[MAXBUF],CommandList[MAXBUF];
699 00121 <span class="keywordtype">char</span>* mycmd;
700 00122 <span class="keywordtype">char</span>* savept;
701 00123 <span class="keywordtype">char</span>* savept2;
703 00125 <span class="comment">// are they even an oper at all?</span>
704 00126 <span class="keywordflow">if</span> (strchr(this->modes,<span class="charliteral">'o'</span>))
706 00128 log(DEBUG,<span class="stringliteral">"*** HasPermission: %s is an oper"</span>,this->nick);
707 00129 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j =0; j < ConfValueEnum(<span class="stringliteral">"type"</span>,&config_f); j++)
709 00131 ConfValue(<span class="stringliteral">"type"</span>,<span class="stringliteral">"name"</span>,j,TypeName,&config_f);
710 00132 <span class="keywordflow">if</span> (!strcmp(TypeName,this->oper))
712 00134 log(DEBUG,<span class="stringliteral">"*** HasPermission: %s is an oper of type '%s'"</span>,this->nick,this->oper);
713 00135 ConfValue(<span class="stringliteral">"type"</span>,<span class="stringliteral">"classes"</span>,j,Classes,&config_f);
714 00136 <span class="keywordtype">char</span>* myclass = strtok_r(Classes,<span class="stringliteral">" "</span>,&savept);
715 00137 <span class="keywordflow">while</span> (myclass)
717 00139 log(DEBUG,<span class="stringliteral">"*** HasPermission: checking classtype '%s'"</span>,myclass);
718 00140 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k =0; k < ConfValueEnum(<span class="stringliteral">"class"</span>,&config_f); k++)
720 00142 ConfValue(<span class="stringliteral">"class"</span>,<span class="stringliteral">"name"</span>,k,ClassName,&config_f);
721 00143 <span class="keywordflow">if</span> (!strcmp(ClassName,myclass))
723 00145 ConfValue(<span class="stringliteral">"class"</span>,<span class="stringliteral">"commands"</span>,k,CommandList,&config_f);
724 00146 log(DEBUG,<span class="stringliteral">"*** HasPermission: found class named %s with commands: '%s'"</span>,ClassName,CommandList);
727 00149 mycmd = strtok_r(CommandList,<span class="stringliteral">" "</span>,&savept2);
728 00150 <span class="keywordflow">while</span> (mycmd)
730 00152 <span class="keywordflow">if</span> (!strcasecmp(mycmd,command))
732 00154 log(DEBUG,<span class="stringliteral">"*** Command %s found, returning true"</span>,command);
733 00155 <span class="keywordflow">return</span> <span class="keyword">true</span>;
735 00157 mycmd = strtok_r(NULL,<span class="stringliteral">" "</span>,&savept2);
739 00161 myclass = strtok_r(NULL,<span class="stringliteral">" "</span>,&savept);
744 00166 <span class="keywordflow">return</span> <span class="keyword">false</span>;
749 <a name="a5" doxytag="userrec::InviteTo"></a><p>
750 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
753 <table cellpadding="0" cellspacing="0" border="0">
755 <td class="md" nowrap valign="top"> void userrec::InviteTo </td>
756 <td class="md" valign="top">( </td>
757 <td class="md" nowrap valign="top">char * </td>
758 <td class="mdname1" valign="top" nowrap> <em>channel</em> </td>
759 <td class="md" valign="top"> ) </td>
760 <td class="md" nowrap><code> [virtual]</code></td>
767 <table cellspacing=5 cellpadding=0 border=0>
775 Adds a channel to a users invite list (invites them to a channel).
779 Definition at line <a class="el" href="users_8cpp-source.html#l00089">89</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
781 References <a class="el" href="users_8h-source.html#l00039">Invited::channel</a>, and <a class="el" href="users_8h-source.html#l00114">invites</a>.
783 <div class="fragment"><pre>00090 {
784 00091 <a class="code" href="classInvited.html">Invited</a> i;
785 00092 strlcpy(i.<a class="code" href="classInvited.html#o0">channel</a>,channel,CHANMAX);
786 00093 <a class="code" href="classuserrec.html#r0">invites</a>.push_back(i);
791 <a name="a4" doxytag="userrec::IsInvited"></a><p>
792 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
795 <table cellpadding="0" cellspacing="0" border="0">
797 <td class="md" nowrap valign="top"> bool userrec::IsInvited </td>
798 <td class="md" valign="top">( </td>
799 <td class="md" nowrap valign="top">char * </td>
800 <td class="mdname1" valign="top" nowrap> <em>channel</em> </td>
801 <td class="md" valign="top"> ) </td>
802 <td class="md" nowrap><code> [virtual]</code></td>
809 <table cellspacing=5 cellpadding=0 border=0>
817 Returns true if a user is invited to a channel.
821 Definition at line <a class="el" href="users_8cpp-source.html#l00075">75</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
823 References <a class="el" href="users_8h-source.html#l00114">invites</a>.
825 <div class="fragment"><pre>00076 {
826 00077 <span class="keywordflow">for</span> (InvitedList::iterator i = <a class="code" href="classuserrec.html#r0">invites</a>.begin(); i != <a class="code" href="classuserrec.html#r0">invites</a>.end(); i++)
828 00079 <span class="keywordflow">if</span> (i->channel) {
829 00080 <span class="keywordflow">if</span> (!strcasecmp(i->channel,channel))
831 00082 <span class="keywordflow">return</span> <span class="keyword">true</span>;
835 00086 <span class="keywordflow">return</span> <span class="keyword">false</span>;
840 <a name="a6" doxytag="userrec::RemoveInvite"></a><p>
841 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
844 <table cellpadding="0" cellspacing="0" border="0">
846 <td class="md" nowrap valign="top"> void userrec::RemoveInvite </td>
847 <td class="md" valign="top">( </td>
848 <td class="md" nowrap valign="top">char * </td>
849 <td class="mdname1" valign="top" nowrap> <em>channel</em> </td>
850 <td class="md" valign="top"> ) </td>
851 <td class="md" nowrap><code> [virtual]</code></td>
858 <table cellspacing=5 cellpadding=0 border=0>
866 Removes a channel from a users invite list.
868 This member function is called on successfully joining an invite only channel to which the user has previously been invited, to clear the invitation.
870 Definition at line <a class="el" href="users_8cpp-source.html#l00096">96</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
872 References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, and <a class="el" href="users_8h-source.html#l00114">invites</a>.
874 <div class="fragment"><pre>00097 {
875 00098 log(DEBUG,<span class="stringliteral">"Removing invites"</span>);
876 00099 <span class="keywordflow">if</span> (channel)
878 00101 <span class="keywordflow">if</span> (<a class="code" href="classuserrec.html#r0">invites</a>.size())
880 00103 <span class="keywordflow">for</span> (InvitedList::iterator i = <a class="code" href="classuserrec.html#r0">invites</a>.begin(); i != <a class="code" href="classuserrec.html#r0">invites</a>.end(); i++)
882 00105 <span class="keywordflow">if</span> (i->channel)
884 00107 <span class="keywordflow">if</span> (!strcasecmp(i->channel,channel))
886 00109 <a class="code" href="classuserrec.html#r0">invites</a>.erase(i);
887 00110 <span class="keywordflow">return</span>;
897 <a name="a12" doxytag="userrec::SetWriteError"></a><p>
898 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
901 <table cellpadding="0" cellspacing="0" border="0">
903 <td class="md" nowrap valign="top"> void userrec::SetWriteError </td>
904 <td class="md" valign="top">( </td>
905 <td class="md" nowrap valign="top">std::string </td>
906 <td class="mdname1" valign="top" nowrap> <em>error</em> </td>
907 <td class="md" valign="top"> ) </td>
908 <td class="md" nowrap></td>
915 <table cellspacing=5 cellpadding=0 border=0>
923 Sets the write error for a connection.
925 This is done because the actual disconnect of a client may occur at an inopportune time such as half way through /LIST output. The WriteErrors of clients are checked at a more ideal time (in the mainloop) and errored clients purged.
927 Definition at line <a class="el" href="users_8cpp-source.html#l00264">264</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
929 References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, and <a class="el" href="users_8h-source.html#l00210">WriteError</a>.
931 Referenced by <a class="el" href="users_8cpp-source.html#l00170">AddBuffer()</a>, <a class="el" href="users_8cpp-source.html#l00226">AddWriteBuf()</a>, and <a class="el" href="users_8cpp-source.html#l00242">FlushWriteBuf()</a>.
933 <div class="fragment"><pre>00265 {
934 00266 log(DEBUG,<span class="stringliteral">"Setting error string for %s to '%s'"</span>,this->nick,error.c_str());
935 00267 <span class="comment">// don't try to set the error twice, its already set take the first string.</span>
936 00268 <span class="keywordflow">if</span> (this-><a class="code" href="classuserrec.html#o20">WriteError</a> == <span class="stringliteral">""</span>)
937 00269 this-><a class="code" href="classuserrec.html#o20">WriteError</a> = error;
942 <hr><h2>Member Data Documentation</h2>
943 <a name="o7" doxytag="userrec::awaymsg"></a><p>
944 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
947 <table cellpadding="0" cellspacing="0" border="0">
949 <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o7">userrec::awaymsg</a>[512]
954 <table cellspacing=5 cellpadding=0 border=0>
962 The user's away message.
964 If this string is empty, the user is not marked as away.
966 Definition at line <a class="el" href="users_8h-source.html#l00151">151</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
968 Referenced by <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>. </td>
971 <a name="o5" doxytag="userrec::chans"></a><p>
972 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
975 <table cellpadding="0" cellspacing="0" border="0">
977 <td class="md" nowrap valign="top"> <a class="el" href="classucrec.html">ucrec</a> <a class="el" href="classuserrec.html#o5">userrec::chans</a>[MAXCHANS]
982 <table cellspacing=5 cellpadding=0 border=0>
992 Definition at line <a class="el" href="users_8h-source.html#l00142">142</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
994 Referenced by <a class="el" href="modules_8cpp-source.html#l00699">Server::PseudoToUser()</a>, and <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>. </td>
997 <a name="o2" doxytag="userrec::dhost"></a><p>
998 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1001 <table cellpadding="0" cellspacing="0" border="0">
1003 <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o2">userrec::dhost</a>[256]
1008 <table cellspacing=5 cellpadding=0 border=0>
1016 The host displayed to non-opers (used for cloaking etc).
1018 This usually matches the value of <a class="el" href="classconnection.html#o1">userrec::host</a>.
1020 Definition at line <a class="el" href="users_8h-source.html#l00130">130</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1022 Referenced by <a class="el" href="users_8cpp-source.html#l00062">GetFullHost()</a>, and <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>. </td>
1025 <a name="o12" doxytag="userrec::dns_done"></a><p>
1026 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1029 <table cellpadding="0" cellspacing="0" border="0">
1031 <td class="md" nowrap valign="top"> bool <a class="el" href="classuserrec.html#o12">userrec::dns_done</a>
1036 <table cellspacing=5 cellpadding=0 border=0>
1044 True when <a class="el" href="classDNS.html">DNS</a> lookups are completed.
1048 Definition at line <a class="el" href="users_8h-source.html#l00179">179</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1050 Referenced by <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>. </td>
1053 <a name="o9" doxytag="userrec::flood"></a><p>
1054 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1057 <table cellpadding="0" cellspacing="0" border="0">
1059 <td class="md" nowrap valign="top"> int <a class="el" href="classuserrec.html#o9">userrec::flood</a>
1064 <table cellspacing=5 cellpadding=0 border=0>
1072 Number of lines the user can place into the buffer (up to the global NetBufferSize bytes) before they are disconnected for excess flood.
1076 Definition at line <a class="el" href="users_8h-source.html#l00162">162</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1078 Referenced by <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>. </td>
1081 <a name="o3" doxytag="userrec::fullname"></a><p>
1082 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1085 <table cellpadding="0" cellspacing="0" border="0">
1087 <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o3">userrec::fullname</a>[128]
1092 <table cellspacing=5 cellpadding=0 border=0>
1100 The users full name.
1104 Definition at line <a class="el" href="users_8h-source.html#l00134">134</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1106 Referenced by <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>. </td>
1109 <a name="o1" doxytag="userrec::ident"></a><p>
1110 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1113 <table cellpadding="0" cellspacing="0" border="0">
1115 <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o1">userrec::ident</a>[64]
1120 <table cellspacing=5 cellpadding=0 border=0>
1128 The users ident reply.
1132 Definition at line <a class="el" href="users_8h-source.html#l00125">125</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1134 Referenced by <a class="el" href="users_8cpp-source.html#l00062">GetFullHost()</a>, <a class="el" href="users_8cpp-source.html#l00069">GetFullRealHost()</a>, <a class="el" href="modules_8cpp-source.html#l00699">Server::PseudoToUser()</a>, <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00680">Server::UserToPseudo()</a>. </td>
1137 <a name="r0" doxytag="userrec::invites"></a><p>
1138 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1141 <table cellpadding="0" cellspacing="0" border="0">
1143 <td class="md" nowrap valign="top"> <a class="el" href="users_8h.html#a6">InvitedList</a> <a class="el" href="classuserrec.html#r0">userrec::invites</a><code> [private]</code>
1148 <table cellspacing=5 cellpadding=0 border=0>
1156 A list of channels the user has a pending invite to.
1160 Definition at line <a class="el" href="users_8h-source.html#l00114">114</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1162 Referenced by <a class="el" href="users_8cpp-source.html#l00089">InviteTo()</a>, <a class="el" href="users_8cpp-source.html#l00075">IsInvited()</a>, <a class="el" href="users_8cpp-source.html#l00096">RemoveInvite()</a>, and <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>. </td>
1165 <a name="o17" doxytag="userrec::lines_in"></a><p>
1166 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1169 <table cellpadding="0" cellspacing="0" border="0">
1171 <td class="md" nowrap valign="top"> long <a class="el" href="classuserrec.html#o17">userrec::lines_in</a>
1176 <table cellspacing=5 cellpadding=0 border=0>
1188 Definition at line <a class="el" href="users_8h-source.html#l00204">204</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1190 Referenced by <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>. </td>
1193 <a name="o4" doxytag="userrec::modes"></a><p>
1194 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1197 <table cellpadding="0" cellspacing="0" border="0">
1199 <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o4">userrec::modes</a>[MAXBUF]
1204 <table cellspacing=5 cellpadding=0 border=0>
1212 The user's mode string.
1214 This may contain any of the following RFC characters: o, w, s, i Your module may define other mode characters as it sees fit.
1216 Definition at line <a class="el" href="users_8h-source.html#l00140">140</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1218 Referenced by <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>. </td>
1221 <a name="o0" doxytag="userrec::nick"></a><p>
1222 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1225 <table cellpadding="0" cellspacing="0" border="0">
1227 <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o0">userrec::nick</a>[NICKMAX]
1232 <table cellspacing=5 cellpadding=0 border=0>
1242 An invalid nickname indicates an unregistered connection prior to the NICK command.
1244 Definition at line <a class="el" href="users_8h-source.html#l00121">121</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1246 Referenced by <a class="el" href="modules_8cpp-source.html#l00966">ConfigReader::DumpErrors()</a>, <a class="el" href="users_8cpp-source.html#l00062">GetFullHost()</a>, <a class="el" href="users_8cpp-source.html#l00069">GetFullRealHost()</a>, <a class="el" href="modules_8cpp-source.html#l00699">Server::PseudoToUser()</a>, and <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>. </td>
1249 <a name="o11" doxytag="userrec::oper"></a><p>
1250 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1253 <table cellpadding="0" cellspacing="0" border="0">
1255 <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o11">userrec::oper</a>[NICKMAX]
1260 <table cellspacing=5 cellpadding=0 border=0>
1268 The oper type they logged in as, if they are an oper.
1270 This is used to check permissions in operclasses, so that we can say 'yay' or 'nay' to any commands they issue. The value of this is the value of a valid 'type name=' tag.
1272 Definition at line <a class="el" href="users_8h-source.html#l00175">175</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1274 Referenced by <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>. </td>
1277 <a name="o14" doxytag="userrec::password"></a><p>
1278 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1281 <table cellpadding="0" cellspacing="0" border="0">
1283 <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o14">userrec::password</a>[MAXBUF]
1288 <table cellspacing=5 cellpadding=0 border=0>
1296 Password specified by the user when they registered.
1298 This is stored even if the block doesnt need a password, so that modules may check it.
1300 Definition at line <a class="el" href="users_8h-source.html#l00189">189</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td>
1303 <a name="o13" doxytag="userrec::pingmax"></a><p>
1304 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1307 <table cellpadding="0" cellspacing="0" border="0">
1309 <td class="md" nowrap valign="top"> unsigned long <a class="el" href="classuserrec.html#o13">userrec::pingmax</a>
1314 <table cellspacing=5 cellpadding=0 border=0>
1322 Number of seconds between PINGs for this user (set from <connect:allow> tag.
1326 Definition at line <a class="el" href="users_8h-source.html#l00183">183</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td>
1329 <a name="o15" doxytag="userrec::recvq"></a><p>
1330 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1333 <table cellpadding="0" cellspacing="0" border="0">
1335 <td class="md" nowrap valign="top"> std::string <a class="el" href="classuserrec.html#o15">userrec::recvq</a>
1340 <table cellspacing=5 cellpadding=0 border=0>
1348 User's receive queue.
1350 Lines from the IRCd awaiting processing are stored here. Upgraded april 2005, old system a bit hairy.
1352 Definition at line <a class="el" href="users_8h-source.html#l00195">195</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1354 Referenced by <a class="el" href="users_8cpp-source.html#l00170">AddBuffer()</a>, <a class="el" href="users_8cpp-source.html#l00196">BufferIsReady()</a>, <a class="el" href="users_8cpp-source.html#l00204">ClearBuffer()</a>, <a class="el" href="users_8cpp-source.html#l00209">GetBuffer()</a>, and <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>. </td>
1357 <a name="o22" doxytag="userrec::recvqmax"></a><p>
1358 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1361 <table cellpadding="0" cellspacing="0" border="0">
1363 <td class="md" nowrap valign="top"> long <a class="el" href="classuserrec.html#o22">userrec::recvqmax</a>
1368 <table cellspacing=5 cellpadding=0 border=0>
1376 Maximum size this user's recvq can become.
1380 Definition at line <a class="el" href="users_8h-source.html#l00218">218</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1382 Referenced by <a class="el" href="users_8cpp-source.html#l00170">AddBuffer()</a>. </td>
1385 <a name="o18" doxytag="userrec::reset_due"></a><p>
1386 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1389 <table cellpadding="0" cellspacing="0" border="0">
1391 <td class="md" nowrap valign="top"> time_t <a class="el" href="classuserrec.html#o18">userrec::reset_due</a>
1396 <table cellspacing=5 cellpadding=0 border=0>
1406 Definition at line <a class="el" href="users_8h-source.html#l00205">205</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1408 Referenced by <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>. </td>
1411 <a name="o8" doxytag="userrec::result"></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"> char <a class="el" href="classuserrec.html#o8">userrec::result</a>[256]
1422 <table cellspacing=5 cellpadding=0 border=0>
1430 Stores the result of the last GetFullHost or GetRealHost call.
1432 You may use this to increase the speed of use of this class.
1434 Definition at line <a class="el" href="users_8h-source.html#l00156">156</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1436 Referenced by <a class="el" href="users_8cpp-source.html#l00062">GetFullHost()</a>, <a class="el" href="users_8cpp-source.html#l00069">GetFullRealHost()</a>, and <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>. </td>
1439 <a name="o16" doxytag="userrec::sendq"></a><p>
1440 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1443 <table cellpadding="0" cellspacing="0" border="0">
1445 <td class="md" nowrap valign="top"> std::string <a class="el" href="classuserrec.html#o16">userrec::sendq</a>
1450 <table cellspacing=5 cellpadding=0 border=0>
1460 Lines waiting to be sent are stored here until their buffer is flushed.
1462 Definition at line <a class="el" href="users_8h-source.html#l00200">200</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1464 Referenced by <a class="el" href="users_8cpp-source.html#l00226">AddWriteBuf()</a>, <a class="el" href="users_8cpp-source.html#l00242">FlushWriteBuf()</a>, and <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>. </td>
1467 <a name="o21" doxytag="userrec::sendqmax"></a><p>
1468 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1471 <table cellpadding="0" cellspacing="0" border="0">
1473 <td class="md" nowrap valign="top"> long <a class="el" href="classuserrec.html#o21">userrec::sendqmax</a>
1478 <table cellspacing=5 cellpadding=0 border=0>
1486 Maximum size this user's sendq can become.
1490 Definition at line <a class="el" href="users_8h-source.html#l00214">214</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1492 Referenced by <a class="el" href="users_8cpp-source.html#l00226">AddWriteBuf()</a>. </td>
1495 <a name="o6" doxytag="userrec::server"></a><p>
1496 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1499 <table cellpadding="0" cellspacing="0" border="0">
1501 <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o6">userrec::server</a>[256]
1506 <table cellspacing=5 cellpadding=0 border=0>
1514 The server the user is connected to.
1518 Definition at line <a class="el" href="users_8h-source.html#l00146">146</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1520 Referenced by <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>. </td>
1523 <a name="o19" doxytag="userrec::threshold"></a><p>
1524 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1527 <table cellpadding="0" cellspacing="0" border="0">
1529 <td class="md" nowrap valign="top"> long <a class="el" href="classuserrec.html#o19">userrec::threshold</a>
1534 <table cellspacing=5 cellpadding=0 border=0>
1544 Definition at line <a class="el" href="users_8h-source.html#l00206">206</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td>
1547 <a name="o10" doxytag="userrec::timeout"></a><p>
1548 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1551 <table cellpadding="0" cellspacing="0" border="0">
1553 <td class="md" nowrap valign="top"> unsigned long <a class="el" href="classuserrec.html#o10">userrec::timeout</a>
1558 <table cellspacing=5 cellpadding=0 border=0>
1566 Number of seconds this user is given to send USER/NICK If they do not send their details in this time limit they will be disconnected.
1570 Definition at line <a class="el" href="users_8h-source.html#l00168">168</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1572 Referenced by <a class="el" href="users_8cpp-source.html#l00028">userrec()</a>. </td>
1575 <a name="o20" doxytag="userrec::WriteError"></a><p>
1576 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1579 <table cellpadding="0" cellspacing="0" border="0">
1581 <td class="md" nowrap valign="top"> std::string <a class="el" href="classuserrec.html#o20">userrec::WriteError</a>
1586 <table cellspacing=5 cellpadding=0 border=0>
1596 Definition at line <a class="el" href="users_8h-source.html#l00210">210</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
1598 Referenced by <a class="el" href="users_8cpp-source.html#l00272">GetWriteError()</a>, and <a class="el" href="users_8cpp-source.html#l00264">SetWriteError()</a>. </td>
1601 <hr>The documentation for this class was generated from the following files:<ul>
1602 <li><a class="el" href="users_8h-source.html">users.h</a><li><a class="el" href="users_8cpp-source.html">users.cpp</a></ul>
1603 <hr size="1"><address style="align: right;"><small>Generated on Thu May 12 02:25:29 2005 for InspIRCd by
1604 <a href="http://www.doxygen.org/index.html">
1605 <img src="doxygen.png" alt="doxygen" align="middle" border=0 >
1606 </a>1.3.3 </small></address>