InspIRCd  2.0
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)
 
void RehashCloneCounts ()
 
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

◆ AddGlobalClone()

void UserManager::AddGlobalClone ( User user)

Add a user to the global clone map

Parameters
userThe user to add

◆ AddLocalClone()

void UserManager::AddLocalClone ( User user)

Add a user to the local clone map

Parameters
userThe user to add

◆ AddUser()

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.

◆ GlobalCloneCount()

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

◆ LocalCloneCount()

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

◆ LocalUserCount()

unsigned int UserManager::LocalUserCount ( )

Return a count of local users on this server only

Returns
The number of local users

◆ ModeCount()

int UserManager::ModeCount ( const char  mode)

Number of users with a certain mode set on them

◆ OperCount()

unsigned int UserManager::OperCount ( )

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

Returns
The number of opers

◆ QuitUser()

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.

◆ RegisteredUserCount()

unsigned int UserManager::RegisteredUserCount ( )

Return a count of fully registered connections only

Returns
The number of registered users

◆ RehashCloneCounts()

void UserManager::RehashCloneCounts ( )

Rebuild clone counts

◆ RemoveCloneCounts()

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

◆ ServerNoticeAll()

void UserManager::ServerNoticeAll ( const char *  text,
  ... 
)

Send a server notice to all local users

Parameters
textThe text format string to send
...The format arguments

◆ ServerPrivmsgAll()

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

◆ UnregisteredUserCount()

unsigned int UserManager::UnregisteredUserCount ( )

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

Returns
The number of unregistered (unknown) connections

◆ UserCount()

unsigned int UserManager::UserCount ( )

Return a count of users, unknown and known connections

Returns
The number of users

Member Data Documentation

◆ all_opers

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

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

◆ clientlist

user_hash* UserManager::clientlist

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

◆ global_clones

clonemap UserManager::global_clones

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

◆ local_count

unsigned int UserManager::local_count

Number of elements in local_users

◆ local_users

LocalUserList UserManager::local_users

Local client list, a list containing only local clients

◆ unregistered_count

unsigned int UserManager::unregistered_count

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

◆ uuidlist

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: