]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/man/userrec.3
Added module sockets to new engine, MAY NOT WORK
[user/henk/code/inspircd.git] / docs / man / userrec.3
1 .TH "userrec" 3 "30 Apr 2004" "InspIRCd" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 userrec \- Holds all information about a user This class stores all information about a user connected to the irc server. 
6
7 .PP
8 .SH SYNOPSIS
9 .br
10 .PP
11 \fC#include <users.h>\fP
12 .PP
13 Inherits \fBconnection\fP.
14 .PP
15 .SS "Public Member Functions"
16
17 .in +1c
18 .ti -1c
19 .RI "\fBuserrec\fP ()"
20 .br
21 .ti -1c
22 .RI "virtual \fB~userrec\fP ()"
23 .br
24 .ti -1c
25 .RI "virtual char * \fBGetFullHost\fP ()"
26 .br
27 .RI "\fIReturns 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.\fP"
28 .ti -1c
29 .RI "virtual char * \fBGetFullRealHost\fP ()"
30 .br
31 .RI "\fIReturns 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.\fP"
32 .ti -1c
33 .RI "virtual bool \fBIsInvited\fP (char *channel)"
34 .br
35 .RI "\fIReturns true if a user is invited to a channel.\fP"
36 .ti -1c
37 .RI "virtual void \fBInviteTo\fP (char *channel)"
38 .br
39 .RI "\fIAdds a channel to a users invite list (invites them to a channel).\fP"
40 .ti -1c
41 .RI "virtual void \fBRemoveInvite\fP (char *channel)"
42 .br
43 .RI "\fIRemoves a channel from a users invite list.\fP"
44 .in -1c
45 .SS "Public Attributes"
46
47 .in +1c
48 .ti -1c
49 .RI "char \fBnick\fP [NICKMAX]"
50 .br
51 .RI "\fIThe users nickname.\fP"
52 .ti -1c
53 .RI "char \fBident\fP [64]"
54 .br
55 .RI "\fIThe users ident reply.\fP"
56 .ti -1c
57 .RI "char \fBdhost\fP [256]"
58 .br
59 .RI "\fIThe host displayed to non-opers (used for cloaking etc).\fP"
60 .ti -1c
61 .RI "char \fBfullname\fP [128]"
62 .br
63 .RI "\fIThe users full name.\fP"
64 .ti -1c
65 .RI "char \fBmodes\fP [MAXBUF]"
66 .br
67 .RI "\fIThe user's mode string.\fP"
68 .ti -1c
69 .RI "\fBucrec\fP \fBchans\fP [MAXCHANS]"
70 .br
71 .ti -1c
72 .RI "char \fBserver\fP [256]"
73 .br
74 .RI "\fIThe server the user is connected to.\fP"
75 .ti -1c
76 .RI "char \fBawaymsg\fP [512]"
77 .br
78 .RI "\fIThe user's away message.\fP"
79 .ti -1c
80 .RI "char \fBresult\fP [256]"
81 .br
82 .RI "\fIStores the result of the last GetFullHost or GetRealHost call.\fP"
83 .ti -1c
84 .RI "int \fBflood\fP"
85 .br
86 .RI "\fINumber of lines the user can place into the buffer (up to the global NetBufferSize bytes) before they are disconnected for excess flood.\fP"
87 .ti -1c
88 .RI "unsigned long \fBtimeout\fP"
89 .br
90 .RI "\fINumber 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.\fP"
91 .in -1c
92 .SS "Private Attributes"
93
94 .in +1c
95 .ti -1c
96 .RI "\fBInvitedList\fP \fBinvites\fP"
97 .br
98 .RI "\fIA list of channels the user has a pending invite to.\fP"
99 .in -1c
100 .SH "Detailed Description"
101 .PP 
102 Holds all information about a user This class stores all information about a user connected to the irc server.
103
104 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. 
105 .PP
106 Definition at line 78 of file users.h.
107 .SH "Constructor & Destructor Documentation"
108 .PP 
109 .SS "userrec::userrec ()"
110 .PP
111 Definition at line 11 of file users.cpp.
112 .PP
113 References connection::bytes_in, connection::bytes_out, ucrec::channel, chans, connection::cmds_in, connection::cmds_out, connection::fd, flood, connection::haspassed, connection::idle_lastmsg, invites, connection::lastping, connection::nping, connection::port, connection::registered, connection::signon, timeout, and ucrec::uc_modes.
114 .PP
115 .nf
116 12 {
117 13         // the PROPER way to do it, AVOID bzero at *ALL* costs
118 14         strcpy(nick,'');
119 15         strcpy(ip,'127.0.0.1');
120 16         timeout = 0;
121 17         strcpy(ident,'');
122 18         strcpy(host,'');
123 19         strcpy(dhost,'');
124 20         strcpy(fullname,'');
125 21         strcpy(modes,'');
126 22         strcpy(inbuf,'');
127 23         strcpy(server,'');
128 24         strcpy(awaymsg,'');
129 25         fd = lastping = signon = idle_lastmsg = nping = registered = 0;
130 26         flood = port = bytes_in = bytes_out = cmds_in = cmds_out = 0;
131 27         haspassed = false;
132 28         strcpy(result,'');
133 29         for (int i = 0; i < MAXCHANS; i++)
134 30         {
135 31                 this->chans[i].channel = NULL;
136 32                 this->chans[i].uc_modes = 0;
137 33         }
138 34         invites.clear();
139 35 }
140 .fi
141 .SS "virtual userrec::~userrec ()\fC [inline, virtual]\fP"
142 .PP
143 Definition at line 142 of file users.h.
144 .PP
145 .nf
146 142 {  }
147 .fi
148 .SH "Member Function Documentation"
149 .PP 
150 .SS "char * userrec::GetFullHost ()\fC [virtual]\fP"
151 .PP
152 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.Definition at line 39 of file users.cpp.
153 .PP
154 References result.
155 .PP
156 .nf
157 40 {
158 41         sprintf(result,'%s!%s@%s',nick,ident,dhost);
159 42         return result;
160 43 }
161 .fi
162 .SS "char * userrec::GetFullRealHost ()\fC [virtual]\fP"
163 .PP
164 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.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.Definition at line 46 of file users.cpp.
165 .PP
166 References result.
167 .PP
168 .nf
169 47 {
170 48         sprintf(result,'%s!%s@%s',nick,ident,host);
171 49         return result;
172 50 }
173 .fi
174 .SS "void userrec::InviteTo (char * channel)\fC [virtual]\fP"
175 .PP
176 Adds a channel to a users invite list (invites them to a channel).Definition at line 66 of file users.cpp.
177 .PP
178 References Invited::channel, and invites.
179 .PP
180 .nf
181 67 {
182 68         Invited i;
183 69         strcpy(i.channel,channel);
184 70         invites.push_back(i);
185 71 }
186 .fi
187 .SS "bool userrec::IsInvited (char * channel)\fC [virtual]\fP"
188 .PP
189 Returns true if a user is invited to a channel.Definition at line 52 of file users.cpp.
190 .PP
191 References invites.
192 .PP
193 .nf
194 53 {
195 54         for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
196 55         {
197 56                 if (i->channel) {
198 57                         if (!strcasecmp(i->channel,channel))
199 58                         {
200 59                                 return true;
201 60                         }
202 61                 }
203 62         }
204 63         return false;
205 64 }
206 .fi
207 .SS "void userrec::RemoveInvite (char * channel)\fC [virtual]\fP"
208 .PP
209 Removes a channel from a users invite list.This member function is called on successfully joining an invite only channel to which the user has previously been invited, to clear the invitation.Definition at line 73 of file users.cpp.
210 .PP
211 References invites.
212 .PP
213 .nf
214 74 {
215 75         log(DEBUG,'Removing invites');
216 76         if (channel)
217 77         {
218 78                 if (invites.size())
219 79                 {
220 80                         for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
221 81                         {
222 82                                 if (i->channel)
223 83                                 {
224 84                                         if (!strcasecmp(i->channel,channel))
225 85                                         {
226 86                                                 invites.erase(i);
227 87                                                 return;
228 88                                         }
229 89                                 }
230 90                         }
231 91                 }
232 92         }
233 93 }
234 .fi
235 .SH "Member Data Documentation"
236 .PP 
237 .SS "char userrec::awaymsg[512]"
238 .PP
239 The user's away message.If this string is empty, the user is not marked as away.Definition at line 121 of file users.h.
240 .SS "\fBucrec\fP userrec::chans[MAXCHANS]"
241 .PP
242 Definition at line 112 of file users.h.
243 .PP
244 Referenced by userrec().
245 .SS "char userrec::dhost[256]"
246 .PP
247 The host displayed to non-opers (used for cloaking etc).This usually matches the value of \fBuserrec::host\fP.Definition at line 100 of file users.h.
248 .SS "int userrec::flood"
249 .PP
250 Number of lines the user can place into the buffer (up to the global NetBufferSize bytes) before they are disconnected for excess flood.Definition at line 132 of file users.h.
251 .PP
252 Referenced by userrec().
253 .SS "char userrec::fullname[128]"
254 .PP
255 The users full name.Definition at line 104 of file users.h.
256 .SS "char userrec::ident[64]"
257 .PP
258 The users ident reply.Definition at line 95 of file users.h.
259 .SS "\fBInvitedList\fP userrec::invites\fC [private]\fP"
260 .PP
261 A list of channels the user has a pending invite to.Definition at line 84 of file users.h.
262 .PP
263 Referenced by InviteTo(), IsInvited(), RemoveInvite(), and userrec().
264 .SS "char userrec::modes[MAXBUF]"
265 .PP
266 The user's mode string.This may contain any of the following RFC characters: o, w, s, i Your module may define other mode characters as it sees fit.Definition at line 110 of file users.h.
267 .SS "char userrec::nick[NICKMAX]"
268 .PP
269 The users nickname.An invalid nickname indicates an unregistered connection prior to the NICK command.Definition at line 91 of file users.h.
270 .PP
271 Referenced by Server::QuitUser().
272 .SS "char userrec::result[256]"
273 .PP
274 Stores the result of the last GetFullHost or GetRealHost call.You may use this to increase the speed of use of this class.Definition at line 126 of file users.h.
275 .PP
276 Referenced by GetFullHost(), and GetFullRealHost().
277 .SS "char userrec::server[256]"
278 .PP
279 The server the user is connected to.Definition at line 116 of file users.h.
280 .SS "unsigned long userrec::timeout"
281 .PP
282 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.Definition at line 138 of file users.h.
283 .PP
284 Referenced by userrec().
285
286 .SH "Author"
287 .PP 
288 Generated automatically by Doxygen for InspIRCd from the source code.