*/
const CloneCounts zeroclonecounts;
+ /** Local client list, a list containing only local clients
+ */
+ LocalList local_users;
+
public:
/** Constructor, initializes variables
*/
*/
user_hash uuidlist;
- /** Local client list, a list containing only local clients
- */
- LocalList local_users;
-
/** Oper list, a vector containing all local and remote opered users
*/
OperList all_opers;
*/
user_hash& GetUsers() { return clientlist; }
+ /** Get a list containing all local users
+ * @return A const list of local users
+ */
+ const LocalList& GetLocalUsers() const { return local_users; }
+
/** Send a server notice to all local users
* @param text The text format string to send
* @param ... The format arguments
void MessageCommandBase::SendAll(User* user, const std::string& msg, MessageType mt)
{
const std::string message = ":" + user->GetFullHost() + " " + MessageTypeString[mt] + " $* :" + msg;
- const UserManager::LocalList& list = ServerInstance->Users->local_users;
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i)
{
if ((*i)->registered == REG_ALL)
{
results.push_back(InspIRCd::Format("211 %s nick[ident@%s] sendq cmds_out bytes_out cmds_in bytes_in time_open", user->nick.c_str(), (c == 'l' ? "host" : "ip")));
- const UserManager::LocalList& list = ServerInstance->Users->local_users;
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i)
{
LocalUser* u = *i;
std::string wallop("WALLOPS :");
wallop.append(parameters[0]);
- for (UserManager::LocalList::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); ++i)
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i)
{
User* t = *i;
if (t->IsModeSet(wallopsmode))
/* Send an error notice to all users, registered or not */
void InspIRCd::SendError(const std::string &s)
{
- for (UserManager::LocalList::const_iterator i = this->Users->local_users.begin(); i != this->Users->local_users.end(); ++i)
+ const UserManager::LocalList& list = Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i)
{
User* u = *i;
if (u->registered == REG_ALL)
ports.clear();
/* Close all client sockets, or the new process inherits them */
- UserManager::LocalList& list = Users->local_users;
- for (UserManager::LocalList::iterator i = list.begin(); i != list.end(); ++i)
+ const UserManager::LocalList& list = Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i)
Users->QuitUser(*i, "Server shutdown");
GlobalCulls.Apply();
if (gi == NULL)
throw ModuleException("Unable to initialize geoip, are you missing GeoIP.dat?");
- for (UserManager::LocalList::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); ++i)
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i)
{
LocalUser* user = *i;
if ((user->registered == REG_ALL) && (!ext.get(user)))
unsigned int unknown = 0;
std::map<std::string, unsigned int> results;
- for (LocalUserList::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); ++i)
+
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i)
{
std::string* cc = ext.get(*i);
if (cc)
{
std::map<std::string,int> closed;
- for (UserManager::LocalList::const_iterator u = ServerInstance->Users->local_users.begin(); u != ServerInstance->Users->local_users.end(); ++u)
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator u = list.begin(); u != list.end(); ++u)
{
LocalUser* user = *u;
if (user->registered != REG_ALL)
if (redirect_all_immediately)
{
/* Redirect everyone but the oper sending the command */
- for (UserManager::LocalList::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); ++i)
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i)
{
LocalUser* t = *i;
if (!t->IsOper())
{
std::string msg = "*** From " + src->nick + ": " + parameters[1];
int mlen = parameters[0].length();
- for (UserManager::LocalList::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); ++i)
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i)
{
User* user = *i;
for (int n = 0; n < mlen; n++)
if (!forcequit)
return;
- for (UserManager::LocalList::const_iterator iter = ServerInstance->Users->local_users.begin(); iter != ServerInstance->Users->local_users.end(); ++iter)
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator iter = list.begin(); iter != list.end(); ++iter)
{
/* Fix by Brain: Dont quit UID users */
User* n = *iter;
// Does not change the server of quitting users because those are not in the list
ServerInstance->FakeClient->server = newserver;
- const UserManager::LocalList& list = ServerInstance->Users->local_users;
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i)
(*i)->server = newserver;
}
void ResetMembershipIds()
{
// Set all membership ids to 0
- const UserManager::LocalList& list = ServerInstance->Users->local_users;
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
for (UserManager::LocalList::iterator i = list.begin(); i != list.end(); ++i)
{
LocalUser* user = *i;
, VersionString(ServerInstance->GetVersionString())
, fullversion(ServerInstance->GetVersionString(true))
, Socket(NULL), sid(ServerInstance->Config->GetSID()), ServerUser(ServerInstance->FakeClient)
- , age(ServerInstance->Time()), Warned(false), bursting(false), UserCount(ServerInstance->Users->local_users.size())
+ , age(ServerInstance->Time()), Warned(false), bursting(false), UserCount(ServerInstance->Users.GetLocalUsers().size())
, OperCount(0), rtt(0), StartBurst(0), Hidden(false)
{
AddHashEntry();
if (ELines.empty())
return;
- for (UserManager::LocalList::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++)
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator u2 = list.begin(); u2 != list.end(); u2++)
{
LocalUser* u = *u2;
void ELine::Unset()
{
/* remove exempt from everyone and force recheck after deleting eline */
- for (UserManager::LocalList::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++)
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator u2 = list.begin(); u2 != list.end(); u2++)
{
LocalUser* u = *u2;
u->exempt = false;
// applies lines, removing clients and changing nicks etc as applicable
void XLineManager::ApplyLines()
{
- UserManager::LocalList& list = ServerInstance->Users->local_users;
- for (UserManager::LocalList::iterator j = list.begin(); j != list.end(); ++j)
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator j = list.begin(); j != list.end(); ++j)
{
LocalUser* u = *j;
void ELine::OnAdd()
{
/* When adding one eline, only check the one eline */
- for (UserManager::LocalList::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++)
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator u2 = list.begin(); u2 != list.end(); u2++)
{
LocalUser* u = *u2;
if (this->Matches(u))