00001 /* +------------------------------------+ 00002 * | Inspire Internet Relay Chat Daemon | 00003 * +------------------------------------+ 00004 * 00005 * Inspire is copyright (C) 2002-2004 ChatSpike-Dev. 00006 * E-mail: 00007 * <brain@chatspike.net> 00008 * <Craig@chatspike.net> 00009 * 00010 * Written by Craig Edwards, Craig McLure, and others. 00011 * This program is free but copyrighted software; see 00012 * the file COPYING for details. 00013 * 00014 * --------------------------------------------------- 00015 */ 00016 00017 #include "inspircd_config.h" 00018 #include "channels.h" 00019 #include "connection.h" 00020 #include "inspstring.h" 00021 #include <string> 00022 00023 #ifndef __USERS_H__ 00024 #define __USERS_H__ 00025 00026 #define STATUS_OP 4 00027 #define STATUS_HOP 2 00028 #define STATUS_VOICE 1 00029 #define STATUS_NORMAL 0 00030 00031 #define CC_ALLOW 0 00032 #define CC_DENY 1 00033 00036 class Invited : public classbase 00037 { 00038 public: 00039 char channel[CHANMAX]; 00040 }; 00041 00042 00045 class ConnectClass : public classbase 00046 { 00047 public: 00050 int type; 00053 int registration_timeout; 00056 int flood; 00059 char host[MAXBUF]; 00062 int pingtime; 00065 char pass[MAXBUF]; 00066 00069 long threshold; 00070 00071 ConnectClass() 00072 { 00073 registration_timeout = 0; 00074 flood = 0; 00075 pingtime = 0; 00076 threshold = 0; 00077 strlcpy(host,"",MAXBUF); 00078 strlcpy(pass,"",MAXBUF); 00079 } 00080 }; 00081 00084 typedef std::vector<Invited> InvitedList; 00085 00086 00087 00090 typedef std::vector<ConnectClass> ClassVector; 00091 00098 class userrec : public connection 00099 { 00100 private: 00101 00104 InvitedList invites; 00105 public: 00106 00111 char nick[NICKMAX]; 00112 00115 char ident[64]; 00116 00120 char dhost[256]; 00121 00124 char fullname[128]; 00125 00130 char modes[MAXBUF]; 00131 00132 ucrec chans[MAXCHANS]; 00133 00136 char server[256]; 00137 00141 char awaymsg[512]; 00142 00146 char result[256]; 00147 00152 int flood; 00153 00158 unsigned long timeout; 00159 00165 char oper[NICKMAX]; 00166 00169 bool dns_done; 00170 00173 unsigned long pingmax; 00174 00179 char password[MAXBUF]; 00180 00185 std::string recvq; 00186 00189 long lines_in; 00190 time_t reset_due; 00191 long threshold; 00192 00193 userrec(); 00194 00195 virtual ~userrec() { } 00196 00201 virtual char* GetFullHost(); 00202 00208 virtual char* GetFullRealHost(); 00209 00212 virtual bool IsInvited(char* channel); 00213 00216 virtual void InviteTo(char* channel); 00217 00222 virtual void RemoveInvite(char* channel); 00223 00228 bool HasPermission(char* command); 00229 00237 bool AddBuffer(std::string a); 00238 00242 bool BufferIsReady(); 00243 00246 void ClearBuffer(); 00247 00255 std::string GetBuffer(); 00256 00257 }; 00258 00259 00260 #endif