4 Revision 1.1 2003/01/23 19:45:58 brain
7 Revision 1.9 2003/01/22 00:44:26 brain
8 Added documentation comments
10 Revision 1.8 2003/01/21 21:11:17 brain
13 Revision 1.7 2003/01/17 13:21:38 brain
14 Added CONNECT ALLOW and CONNECT DENY config tags
17 Revision 1.6 2003/01/17 10:37:55 brain
18 Added /INVITE command and relevent structures
20 Revision 1.5 2003/01/16 20:11:56 brain
21 fixed some ugly pointer bugs (thanks dblack and a|KK|y!)
23 Revision 1.4 2003/01/15 22:47:44 brain
24 Changed user and channel structs to classes (finally)
26 Revision 1.3 2003/01/14 21:14:30 brain
27 added /ISON command (for mIRC etc basic notify)
32 #include "inspircd_config.h"
42 #define STATUS_VOICE 1
43 #define STATUS_NORMAL 0
48 /** Holds a channel name to which a user has been invited.
53 char channel[CHANMAX];
57 /** Holds information relevent to <connect allow> and <connect deny> tags in the config file.
67 /** Holds a complete list of all channels to which a user has been invited and has not yet joined.
69 typedef vector<Invited> InvitedList;
73 /** Holds a complete list of all allow and deny tags from the configuration file (connection classes)
75 typedef vector<ConnectClass> ClassVector;
77 /** Holds all information about a user
78 * This class stores all information about a user connected to the irc server. Everything about a
79 * connection is stored here primarily, from the user's socket ID (file descriptor) through to the
80 * user's nickname and hostname. Use the Find method of the server class to locate a specific user
87 /** A list of channels the user has a pending invite to.
92 /** The users nickname.
93 * An invalid nickname indicates an unregistered connection prior to the NICK command.
98 /** The users ip address in network order.
102 /** The users ident reply.
106 /** The users hostname, or ip address in string form.
110 /** The host displayed to non-opers (used for cloaking etc).
111 * This usually matches the value of userrec::host.
115 /** The users full name.
119 /** The users file descriptor.
120 * If this is zero, the socket has been closed and the core has not yet
121 * realised and removed the record from memory.
125 /** The user's mode string.
126 * This may contain any of the following RFC characters: o, w, s, i
127 * Your module may define other mode characters as it sees fit.
131 /** The users input buffer.
132 * Used by the C recv() function.
136 /** The last time the user was pinged by the core.
137 * When this value is more than 120 seconds difference from 'time(NULL)', a ping is sent
138 * to the client. If the user has an outstanding PING request the next time this
139 * event occurs after 4 total minutes, they are disconnected.
143 /** The users signon time.
147 /** The time the user last sent a message.
148 * See also userrec::lastping and userrec::signon
152 /** True if the user replied to their last ping.
153 * If this is true, the user can be sent another ping at the specified time, otherwise
154 * they will be discnnected. See also userrec::lastping
158 /** Bit 1 is set if the user sent a NICK command, bit 2 is set if the user sent a USER command.
159 * If both bits are set then the connection is awaiting MOTD. Sending of MOTD sets bit 3, and
160 * makes the value of userrec::registered == 7, showing a fully established client session.
164 /** A list of the channels the user is currently on.
165 * If any of these values are NULL, the record is not in use and may be associated with
166 * a channel by the JOIN command. see RFC 1459.
168 ucrec chans[MAXCHANS];
170 /** The server the user is connected to.
174 /** The user's away message.
175 * If this string is empty, the user is not marked as away.
179 /** The port that the user connected to.
183 /** Stores the number of incoming bytes from the connection.
188 /** Stores the number of outgoing bytes to the connection.
193 /** Stores the number of incoming commands from the connection.
198 /** Stores the number of outgoing commands to the connection.
203 /** Stores the result of the last GetFullHost or GetRealHost call.
204 * You may use this to increase the speed of use of this class.
208 /** True if a correct password has been given using PASS command.
209 * If the user is a member of a connection class that does not require a password,
210 * the value stored here is of no use.
216 virtual ~userrec() { }
218 /** Returns the full displayed host of the user
219 * This member function returns the hostname of the user as seen by other users
220 * on the server, in nick!ident&at;host form.
222 virtual char* GetFullHost();
224 /** Returns the full real host of the user
225 * This member function returns the hostname of the user as seen by other users
226 * on the server, in nick!ident&at;host form. If any form of hostname cloaking is in operation,
227 * e.g. through a module, then this method will ignore it and return the true hostname.
229 virtual char* GetFullRealHost();
231 /** Returns true if a user is invited to a channel.
233 virtual bool IsInvited(char* channel);
235 /** Adds a channel to a users invite list (invites them to a channel)
237 virtual void InviteTo(char* channel);
239 /** Removes a channel from a users invite list.
240 * This member function is called on successfully joining an invite only channel
241 * to which the user has previously been invited, to clear the invitation.
243 virtual void RemoveInvite(char* channel);