]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/users.h
Removed deprecated class 'packet'
[user/henk/code/inspircd.git] / include / users.h
index 901b303215b654cc4f62307ea2c6707b7c7e8984..f915a6e5f8ebe16cd573158191f49a570eadad59 100644 (file)
@@ -1,12 +1,23 @@
-/*
-
-
-*/
+/*       +------------------------------------+
+ *       | Inspire Internet Relay Chat Daemon |
+ *       +------------------------------------+
+ *
+ *  Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ *                       E-mail:
+ *                <brain@chatspike.net>
+ *               <Craig@chatspike.net>
+ *     
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ *            the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
 
 #include "inspircd_config.h" 
 #include "channels.h"
 #include "connection.h"
-
+#include "inspstring.h"
 #include <string>
  
 #ifndef __USERS_H__ 
@@ -34,9 +45,33 @@ class Invited : public classbase
 class ConnectClass : public classbase
 {
  public:
+       /** Type of line, either CC_ALLOW or CC_DENY
+        */
        int type;
+       /** Max time to register the connection in seconds
+        */
+       int registration_timeout;
+       /** Number of lines in buffer before excess flood is triggered
+        */
+       int flood;
+       /** Host mask for this line
+        */
        char host[MAXBUF];
+       /** Number of seconds between pings for this line
+        */
+       int pingtime;
+       /** (Optional) Password for this line
+        */
        char pass[MAXBUF];
+       
+       ConnectClass()
+       {
+               registration_timeout = 0;
+               flood = 0;
+               pingtime = 0;
+               strlcpy(host,"",MAXBUF);
+               strlcpy(pass,"",MAXBUF);
+       }
 };
 
 /** Holds a complete list of all channels to which a user has been invited and has not yet joined.
@@ -105,6 +140,33 @@ class userrec : public connection
         */
        char result[256];
        
+       /** Number of lines the user can place into the buffer
+        * (up to the global NetBufferSize bytes) before they
+        * are disconnected for excess flood
+        */
+       int flood;
+       
+       /** 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
+        */
+       unsigned long timeout;
+       
+       /** The oper type they logged in as, if they are an oper.
+        * This is used to check permissions in operclasses, so that
+        * we can say 'yay' or 'nay' to any commands they issue.
+        * The value of this is the value of a valid 'type name=' tag.
+        */
+       char oper[NICKMAX];
+
+        /** True when DNS lookups are completed.
+         */
+        bool dns_done;
+
+       /** Number of seconds between PINGs for this user (set from &lt;connect:allow&gt; tag
+        */
+       unsigned long pingmax;
+
        userrec();
        
        virtual ~userrec() {  }
@@ -136,6 +198,12 @@ class userrec : public connection
         */
        virtual void RemoveInvite(char* channel);
        
+       /** Returns true or false for if a user can execute a privilaged oper command.
+        * This is done by looking up their oper type from userrec::oper, then referencing
+        * this to their oper classes and checking the commands they can execute.
+        */
+       bool HasPermission(char* command);
+       
 };