1 .TH "userrec" 3 "30 Apr 2004" "InspIRCd" \" -*- nroff -*-
5 userrec \- Holds all information about a user This class stores all information about a user connected to the irc server.
11 \fC#include <users.h>\fP
13 Inherits \fBconnection\fP.
15 .SS "Public Member Functions"
19 .RI "\fBuserrec\fP ()"
22 .RI "virtual \fB~userrec\fP ()"
25 .RI "virtual char * \fBGetFullHost\fP ()"
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"
29 .RI "virtual char * \fBGetFullRealHost\fP ()"
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"
33 .RI "virtual bool \fBIsInvited\fP (char *channel)"
35 .RI "\fIReturns true if a user is invited to a channel.\fP"
37 .RI "virtual void \fBInviteTo\fP (char *channel)"
39 .RI "\fIAdds a channel to a users invite list (invites them to a channel).\fP"
41 .RI "virtual void \fBRemoveInvite\fP (char *channel)"
43 .RI "\fIRemoves a channel from a users invite list.\fP"
45 .SS "Public Attributes"
49 .RI "char \fBnick\fP [NICKMAX]"
51 .RI "\fIThe users nickname.\fP"
53 .RI "char \fBident\fP [64]"
55 .RI "\fIThe users ident reply.\fP"
57 .RI "char \fBdhost\fP [256]"
59 .RI "\fIThe host displayed to non-opers (used for cloaking etc).\fP"
61 .RI "char \fBfullname\fP [128]"
63 .RI "\fIThe users full name.\fP"
65 .RI "char \fBmodes\fP [MAXBUF]"
67 .RI "\fIThe user's mode string.\fP"
69 .RI "\fBucrec\fP \fBchans\fP [MAXCHANS]"
72 .RI "char \fBserver\fP [256]"
74 .RI "\fIThe server the user is connected to.\fP"
76 .RI "char \fBawaymsg\fP [512]"
78 .RI "\fIThe user's away message.\fP"
80 .RI "char \fBresult\fP [256]"
82 .RI "\fIStores the result of the last GetFullHost or GetRealHost call.\fP"
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"
88 .RI "unsigned long \fBtimeout\fP"
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"
92 .SS "Private Attributes"
96 .RI "\fBInvitedList\fP \fBinvites\fP"
98 .RI "\fIA list of channels the user has a pending invite to.\fP"
100 .SH "Detailed Description"
102 Holds all information about a user This class stores all information about a user connected to the irc server.
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.
106 Definition at line 78 of file users.h.
107 .SH "Constructor & Destructor Documentation"
109 .SS "userrec::userrec ()"
111 Definition at line 11 of file users.cpp.
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.
117 13 // the PROPER way to do it, AVOID bzero at *ALL* costs
119 15 strcpy(ip,'127.0.0.1');
124 20 strcpy(fullname,'');
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++)
135 31 this->chans[i].channel = NULL;
136 32 this->chans[i].uc_modes = 0;
141 .SS "virtual userrec::~userrec ()\fC [inline, virtual]\fP"
143 Definition at line 142 of file users.h.
148 .SH "Member Function Documentation"
150 .SS "char * userrec::GetFullHost ()\fC [virtual]\fP"
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.
158 41 sprintf(result,'%s!%s@%s',nick,ident,dhost);
162 .SS "char * userrec::GetFullRealHost ()\fC [virtual]\fP"
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.
170 48 sprintf(result,'%s!%s@%s',nick,ident,host);
174 .SS "void userrec::InviteTo (char * channel)\fC [virtual]\fP"
176 Adds a channel to a users invite list (invites them to a channel).Definition at line 66 of file users.cpp.
178 References Invited::channel, and invites.
183 69 strcpy(i.channel,channel);
184 70 invites.push_back(i);
187 .SS "bool userrec::IsInvited (char * channel)\fC [virtual]\fP"
189 Returns true if a user is invited to a channel.Definition at line 52 of file users.cpp.
195 54 for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
198 57 if (!strcasecmp(i->channel,channel))
207 .SS "void userrec::RemoveInvite (char * channel)\fC [virtual]\fP"
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.
215 75 log(DEBUG,'Removing invites');
218 78 if (invites.size())
220 80 for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
224 84 if (!strcasecmp(i->channel,channel))
235 .SH "Member Data Documentation"
237 .SS "char userrec::awaymsg[512]"
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]"
242 Definition at line 112 of file users.h.
244 Referenced by userrec().
245 .SS "char userrec::dhost[256]"
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"
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.
252 Referenced by userrec().
253 .SS "char userrec::fullname[128]"
255 The users full name.Definition at line 104 of file users.h.
256 .SS "char userrec::ident[64]"
258 The users ident reply.Definition at line 95 of file users.h.
259 .SS "\fBInvitedList\fP userrec::invites\fC [private]\fP"
261 A list of channels the user has a pending invite to.Definition at line 84 of file users.h.
263 Referenced by InviteTo(), IsInvited(), RemoveInvite(), and userrec().
264 .SS "char userrec::modes[MAXBUF]"
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]"
269 The users nickname.An invalid nickname indicates an unregistered connection prior to the NICK command.Definition at line 91 of file users.h.
271 Referenced by Server::QuitUser().
272 .SS "char userrec::result[256]"
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.
276 Referenced by GetFullHost(), and GetFullRealHost().
277 .SS "char userrec::server[256]"
279 The server the user is connected to.Definition at line 116 of file users.h.
280 .SS "unsigned long userrec::timeout"
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.
284 Referenced by userrec().
288 Generated automatically by Doxygen for InspIRCd from the source code.