Exemple #1
0
	ModResult OnStats(Stats::Context& stats) override
	{
		if (stats.GetSymbol() != 'G')
			return MOD_RES_PASSTHRU;

		unsigned int unknown = 0;
		std::map<std::string, unsigned int> results;

		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)
				results[*cc]++;
			else
				unknown++;
		}

		for (std::map<std::string, unsigned int>::const_iterator i = results.begin(); i != results.end(); ++i)
		{
			stats.AddRow(801, "GeoIPSTATS " + i->first + " " + ConvToStr(i->second));
		}

		if (unknown)
			stats.AddRow(801, "GeoIPSTATS Unknown " + ConvToStr(unknown));

		return MOD_RES_DENY;
	}
Exemple #2
0
	ModResult OnStats(Stats::Context& stats) override
	{
		if (stats.GetSymbol() != 'R')
			return MOD_RES_PASSTHRU;

		ServerInstance->XLines->InvokeStats("R", 223, stats);
		return MOD_RES_DENY;
	}
Exemple #3
0
	ModResult OnStats(Stats::Context& stats) override
	{
		if (stats.GetSymbol() != 'P')
			return MOD_RES_PASSTHRU;

		unsigned int count = 0;
		const UserManager::OperList& opers = ServerInstance->Users.all_opers;
		for (UserManager::OperList::const_iterator i = opers.begin(); i != opers.end(); ++i)
		{
			User* oper = *i;
			if (!oper->server->IsULine() && (stats.GetSource()->IsOper() || !oper->IsModeSet(hm)))
			{
				LocalUser* lu = IS_LOCAL(oper);
				stats.AddRow(249, oper->nick + " (" + oper->ident + "@" + oper->GetDisplayedHost() + ") Idle: " +
						(lu ? ConvToStr(ServerInstance->Time() - lu->idle_lastmsg) + " secs" : "unavailable"));
				count++;
			}
		}
		stats.AddRow(249, ConvToStr(count)+" OPER(s)");

		return MOD_RES_DENY;
	}