Exemplo n.º 1
0
	void DoStatsReset(CommandSource &source)
	{
		Stats *stats = Serialize::GetObject<Stats *>();
		stats->SetMaxUserCount(UserListByNick.size());
		source.Reply(_("Statistics reset."));
		return;
	}
Exemplo n.º 2
0
	void OnUserConnect(User *u, bool &exempt) override
	{
		Stats *stats = GetStats();

		if (stats && UserListByNick.size() > stats->GetMaxUserCount())
		{
			stats->SetMaxUserCount(UserListByNick.size());
			stats->SetMaxUserTime(Anope::CurTime);

			Server *sserver = u->server;
			if (sserver && sserver->IsSynced())
				Log(this, "maxusers") << "connected - new maximum user count: " << UserListByNick.size();
		}
	}