]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/users.h
A ton more clear() and empty() stuff thats been lingering on the long term todo for...
[user/henk/code/inspircd.git] / include / users.h
index 80d9fb00cfdf046ccafba4f31deaa03c0770b92c..e76c886762662739ce6d11e8cdae45fceb229c0c 100644 (file)
@@ -46,7 +46,11 @@ enum UserModes {
 };
 
 enum RegistrationState {
+
+#ifndef WIN32   // Burlex: This is already defined in win32, luckily it is still 0.
        REG_NONE = 0,           /* Has sent nothing */
+#endif
+
        REG_USER = 1,           /* Has sent USER */
        REG_NICK = 2,           /* Has sent NICK */
        REG_NICKUSER = 3,       /* Bitwise combination of REG_NICK and REG_USER */
@@ -57,7 +61,7 @@ class InspIRCd;
 
 /** Derived from Resolver, and performs user forward/reverse lookups.
  */
-class UserResolver : public Resolver
+class CoreExport UserResolver : public Resolver
 {
  private:
        /** User this class is 'attached' to.
@@ -75,7 +79,7 @@ class UserResolver : public Resolver
 
 /** Holds information relevent to <connect allow> and <connect deny> tags in the config file.
  */
-class ConnectClass : public classbase
+class CoreExport ConnectClass : public classbase
 {
  private:
        /** Type of line, either CC_ALLOW or CC_DENY
@@ -223,14 +227,14 @@ public:
         */
        unsigned long GetMaxLocal()
        {
-               return (maxlocal ? maxlocal : 1);
+               return maxlocal;
        }
 
        /** Returns the maximum number of global sessions
         */
        unsigned long GetMaxGlobal()
        {
-               return (maxglobal ? maxglobal : 1);
+               return maxglobal;
        }
 };
 
@@ -247,6 +251,16 @@ typedef std::vector<ConnectClass> ClassVector;
 typedef std::map<chanrec*, char> UserChanList;
 typedef UserChanList::iterator UCListIter;
 
+class userrec;
+
+class CoreExport VisData
+{
+ public:
+       VisData();
+       virtual ~VisData();
+       virtual bool VisibleTo(userrec* user);
+};
+
 /** Holds all information about a user
  * This class stores all information about a user connected to the irc server. Everything about a
  * connection is stored here primarily, from the user's socket ID (file descriptor) through to the
@@ -254,7 +268,7 @@ typedef UserChanList::iterator UCListIter;
  * by nickname, or the FindDescriptor method of the InspIRCd class to find a specific user by their
  * file descriptor value.
  */
-class userrec : public connection
+class CoreExport userrec : public connection
 {
  private:
        /** Pointer to creator.
@@ -308,6 +322,8 @@ class userrec : public connection
         */
        UserResolver* res_reverse;
 
+       VisData* Visibility;
+
        /** Stored reverse lookup from res_forward
         */
        std::string stored_host;
@@ -696,6 +712,10 @@ class userrec : public connection
         */
        void Oper(const std::string &opertype);
 
+       /** Call this method to find the matching <connect> for a user, and to check them against it.
+        */
+       void CheckClass();
+
        /** Use this method to fully connect a user.
         * This will send the message of the day, check G/K/E lines, etc.
         */