+ /** Get the connect class which this user belongs to. NULL for remote users.
+ * @return A pointer to this user's connect class.
+ */
+ virtual ConnectClass* GetClass();
+
+ /** Default destructor
+ */
+ virtual ~User();
+ virtual CullResult cull();
+};
+
+class CoreExport UserIOHandler : public StreamSocket
+{
+ public:
+ LocalUser* const user;
+ UserIOHandler(LocalUser* me) : user(me) {}
+ void OnDataReady();
+ void OnError(BufferedSocketError error);
+
+ /** Adds to the user's write buffer.
+ * You may add any amount of text up to this users sendq value, if you exceed the
+ * sendq value, the user will be removed, and further buffer adds will be dropped.
+ * @param data The data to add to the write buffer
+ */
+ void AddWriteBuf(const std::string &data);
+};
+
+typedef unsigned int already_sent_t;
+
+class CoreExport LocalUser : public User, public InviteBase
+{
+ public:
+ LocalUser(int fd, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server);
+ CullResult cull();
+
+ UserIOHandler eh;
+
+ /** Stats counter for bytes inbound
+ */
+ int bytes_in;
+
+ /** Stats counter for bytes outbound
+ */
+ int bytes_out;
+
+ /** Stats counter for commands inbound
+ */
+ int cmds_in;
+
+ /** Stats counter for commands outbound
+ */
+ int cmds_out;
+
+ /** Password specified by the user when they registered (if any).
+ * This is stored even if the \<connect> block doesnt need a password, so that
+ * modules may check it.
+ */
+ std::string password;
+
+ /** Contains a pointer to the connect class a user is on from
+ */
+ reference<ConnectClass> MyClass;
+
+ ConnectClass* GetClass();
+
+ /** Call this method to find the matching \<connect> for a user, and to check them against it.
+ */
+ void CheckClass();
+
+ /** Server address and port that this user is connected to.
+ */
+ irc::sockets::sockaddrs server_sa;
+
+ /**
+ * @return The port number of this user.
+ */
+ int GetServerPort();
+
+ /** Used by PING checking code
+ */
+ time_t nping;
+
+ /** This value contains how far into the penalty threshold the user is.
+ * This is used either to enable fake lag or for excess flood quits