usermanager.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __USERMANAGER_H
00015 #define __USERMANAGER_H
00016
00017 #include <list>
00018
00020 typedef std::map<irc::string, unsigned int> clonemap;
00021
00022 class CoreExport UserManager : public Extensible
00023 {
00024 private:
00025 InspIRCd *ServerInstance;
00026
00029 clonemap local_clones;
00030 public:
00031 UserManager(InspIRCd *Instance) : ServerInstance(Instance)
00032 {
00033 }
00034
00035 ~UserManager()
00036 {
00037 for (user_hash::iterator i = clientlist->begin();i != clientlist->end();i++)
00038 {
00039 delete i->second;
00040 }
00041 clientlist->clear();
00042 }
00043
00046 user_hash* clientlist;
00047
00051 user_hash* uuidlist;
00052
00055 std::vector<User*> local_users;
00056
00059 std::list<User*> all_opers;
00060
00064 int unregistered_count;
00065
00069 clonemap global_clones;
00070
00081 void AddUser(InspIRCd* Instance, int socket, int port, bool iscached, sockaddr* ip, const std::string &targetip);
00082
00089 void QuitUser(User *user, const std::string &quitreason, const char* operreason = "");
00090
00094 void AddLocalClone(User *user);
00095
00099 void AddGlobalClone(User *user);
00100
00106 void RemoveCloneCounts(User *user);
00107
00112 unsigned long GlobalCloneCount(User *user);
00113
00118 unsigned long LocalCloneCount(User *user);
00119
00123 unsigned int UserCount();
00124
00128 unsigned int RegisteredUserCount();
00129
00133 unsigned int OperCount();
00134
00138 unsigned int UnregisteredUserCount();
00139
00143 unsigned int LocalUserCount();
00144
00145
00146
00147
00150 int ModeCount(const char mode);
00151
00156 void ServerNoticeAll(const char* text, ...) CUSTOM_PRINTF(2, 3);
00157
00162 void ServerPrivmsgAll(const char* text, ...) CUSTOM_PRINTF(2, 3);
00163
00172 void WriteMode(const char* modes, int flags, const char* text, ...) CUSTOM_PRINTF(4, 5);
00173 };
00174
00175 #endif