InspIRCd  2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations
Public Member Functions | Public Attributes | List of all members
UserManager Class Reference

Public Member Functions

void AddUser (int socket, ListenSocket *via, irc::sockets::sockaddrs *client, irc::sockets::sockaddrs *server)
 
void QuitUser (User *user, const std::string &quitreason, const char *operreason="")
 
void AddLocalClone (User *user)
 
void AddGlobalClone (User *user)
 
void RemoveCloneCounts (User *user)
 
unsigned long GlobalCloneCount (User *user)
 
unsigned long LocalCloneCount (User *user)
 
unsigned int UserCount ()
 
unsigned int RegisteredUserCount ()
 
unsigned int OperCount ()
 
unsigned int UnregisteredUserCount ()
 
unsigned int LocalUserCount ()
 
int ModeCount (const char mode)
 
void ServerNoticeAll (const char *text,...) CUSTOM_PRINTF(2
 
void void ServerPrivmsgAll (const char *text,...) CUSTOM_PRINTF(2
 

Public Attributes

user_hash * clientlist
 
user_hash * uuidlist
 
LocalUserList local_users
 
std::list< User * > all_opers
 
unsigned int unregistered_count
 
unsigned int local_count
 
clonemap global_clones
 

Member Function Documentation

void UserManager::AddGlobalClone ( User user)

Add a user to the global clone map

Parameters
userThe user to add
void UserManager::AddLocalClone ( User user)

Add a user to the local clone map

Parameters
userThe user to add
void UserManager::AddUser ( int  socket,
ListenSocket via,
irc::sockets::sockaddrs client,
irc::sockets::sockaddrs server 
)

Add a client to the system. This will create a new User, insert it into the user_hash, initialize it as not yet registered, and add it to the socket engine.

Parameters
socketThe socket id (file descriptor) this user is on
viaThe socket that this user connected using
clientThe IP address and client port of the user
serverThe server IP address and port used by the user
Returns
This function has no return value, but a call to AddClient may remove the user.
unsigned long UserManager::GlobalCloneCount ( User user)

Return the number of global clones of this user

Parameters
userThe user to get a count for
Returns
The global clone count of this user
unsigned long UserManager::LocalCloneCount ( User user)

Return the number of local clones of this user

Parameters
userThe user to get a count for
Returns
The local clone count of this user
unsigned int UserManager::LocalUserCount ( )

Return a count of local users on this server only

Returns
The number of local users
int UserManager::ModeCount ( const char  mode)

Number of users with a certain mode set on them

unsigned int UserManager::OperCount ( )

Return a count of opered (umode +o) users only

Returns
The number of opers
void UserManager::QuitUser ( User user,
const std::string &  quitreason,
const char *  operreason = "" 
)

Disconnect a user gracefully

Parameters
userThe user to remove
quitreasonThe quit reason to show to normal users
operreasonThe quit reason to show to opers
Returns
Although this function has no return type, on exit the user provided will no longer exist.
unsigned int UserManager::RegisteredUserCount ( )

Return a count of fully registered connections only

Returns
The number of registered users
void UserManager::RemoveCloneCounts ( User user)

Remove all clone counts from the user, you should use this if you change the user's IP address after they have registered.

Parameters
userThe user to remove
void UserManager::ServerNoticeAll ( const char *  text,
  ... 
)

Send a server notice to all local users

Parameters
textThe text format string to send
...The format arguments
void UserManager::ServerPrivmsgAll ( const char *  text,
  ... 
)

Send a server message (PRIVMSG) to all local users

Parameters
textThe text format string to send
...The format arguments
unsigned int UserManager::UnregisteredUserCount ( )

Return a count of unregistered (before NICK/USER) users only

Returns
The number of unregistered (unknown) connections
unsigned int UserManager::UserCount ( )

Return a count of users, unknown and known connections

Returns
The number of users

Member Data Documentation

std::list<User*> UserManager::all_opers

Oper list, a vector containing all local and remote opered users

user_hash* UserManager::clientlist

Client list, a hash_map containing all clients, local and remote

clonemap UserManager::global_clones

Map of global ip addresses for clone counting XXX - this should be private, but m_clones depends on it currently.

unsigned int UserManager::local_count

Number of elements in local_users

LocalUserList UserManager::local_users

Local client list, a list containing only local clients

unsigned int UserManager::unregistered_count

Number of unregistered users online right now. (Unregistered means before USER/NICK/dns)

user_hash* UserManager::uuidlist

Client list stored by UUID. Contains all clients, and is updated automatically by the constructor and destructor of User.


The documentation for this class was generated from the following files: