]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/users.h
Deny TR_NICK mode changes with an invalid nick parameter
[user/henk/code/inspircd.git] / include / users.h
index 76337b2c337edfec83f3c7a5e0ea27b5db7b69c6..6f656a51b32da0114d279228e1eb71d06000167f 100644 (file)
@@ -62,7 +62,7 @@ class UserResolver;
 
 /** Holds information relevent to <connect allow> and <connect deny> tags in the config file.
  */
-struct CoreExport ConnectClass : public classbase
+struct CoreExport ConnectClass : public refcountbase
 {
        /** Type of line, either CC_ALLOW or CC_DENY
         */
@@ -127,12 +127,6 @@ struct CoreExport ConnectClass : public classbase
         */
        unsigned long limit;
 
-       /** Reference counter.
-        * This will be 1 if no users are connected, as long as it is a valid connect block
-        * When it reaches 0, the object should be deleted
-        */
-       unsigned long RefCount;
-
        /** Create a new connect class with no settings.
         */
        ConnectClass(char type, const std::string& mask);
@@ -206,7 +200,7 @@ typedef std::vector< std::pair<irc::string, time_t> > InvitedList;
 
 /** Holds a complete list of all allow and deny tags from the configuration file (connection classes)
  */
-typedef std::vector<ConnectClass*> ClassVector;
+typedef std::vector<reference<ConnectClass> > ClassVector;
 
 /** Typedef for the list of user-channel records for a user
  */
@@ -274,9 +268,8 @@ class CoreExport User : public StreamSocket
        static LocalStringExt OperQuit;
 
        /** Contains a pointer to the connect class a user is on from - this will be NULL for remote connections.
-        * The pointer is guarenteed to *always* be valid. :)
         */
-       ConnectClass *MyClass;
+       reference<ConnectClass> MyClass;
 
        /** Hostname of connection.
         * This should be valid as per RFC1035.
@@ -389,7 +382,7 @@ class CoreExport User : public StreamSocket
 
        /** The server the user is connected to.
         */
-       const char* server;
+       std::string server;
 
        /** The user's away message.
         * If this string is empty, the user is not marked as away.
@@ -451,10 +444,6 @@ class CoreExport User : public StreamSocket
         * @return The port number of this user.
         */
        int GetServerPort();
-       /**
-        * @return The server IP address
-        */
-       std::string GetServerIP();
 
        /** Get client IP string from sockaddr, using static internal buffer
         * @return The IP string
@@ -869,7 +858,7 @@ class CoreExport User : public StreamSocket
        /** Default destructor
         */
        virtual ~User();
-       virtual void cull();
+       virtual bool cull();
 };
 
 /** Derived from Resolver, and performs user forward/reverse lookups.