Exemplo n.º 1
0
	virtual void OnRehash(User *user)
	{
		ConfigReader MyConf(ServerInstance);
		std::string snomasks;
		std::string channel;

		logstreams.clear();

		for (int i = 0; i < MyConf.Enumerate("chanlog"); i++)
		{
			channel = MyConf.ReadValue("chanlog", "channel", i);
			snomasks = MyConf.ReadValue("chanlog", "snomasks", i);

			if (channel.empty() || snomasks.empty())
			{
				ServerInstance->Logs->Log("m_chanlog", DEFAULT, "Malformed chanlog tag, ignoring");
				continue;
			}

			for (std::string::const_iterator it = snomasks.begin(); it != snomasks.end(); it++)
			{
				logstreams.insert(std::make_pair(*it, channel));
				ServerInstance->Logs->Log("m_chanlog", DEFAULT, "Logging %c to %s", *it, channel.c_str());
			}
		}

	}
Exemplo n.º 2
0
	virtual void ReadAliases()
	{
		ConfigReader MyConf(ServerInstance);

		AllowBots = MyConf.ReadFlag("fantasy", "allowbots", "no", 0);

		std::string fpre = MyConf.ReadValue("fantasy","prefix",0);
		fprefix = fpre.empty() ? '!' : fpre[0];

		Aliases.clear();
		for (int i = 0; i < MyConf.Enumerate("alias"); i++)
		{
			Alias a;
			std::string txt;
			txt = MyConf.ReadValue("alias", "text", i);
			a.AliasedCommand = txt.c_str();
			a.ReplaceFormat = MyConf.ReadValue("alias", "replace", i, true);
			a.RequiredNick = MyConf.ReadValue("alias", "requires", i);
			a.ULineOnly = MyConf.ReadFlag("alias", "uline", i);
			a.ChannelCommand = MyConf.ReadFlag("alias", "channelcommand", "no", i);
			a.UserCommand = MyConf.ReadFlag("alias", "usercommand", "yes", i);
			a.OperOnly = MyConf.ReadFlag("alias", "operonly", i);
			a.format = MyConf.ReadValue("alias", "format", i);
			a.CaseSensitive = MyConf.ReadFlag("alias", "matchcase", i);
			Aliases.insert(std::make_pair(txt, a));
		}
	}
Exemplo n.º 3
0
	virtual void ReadAliases()
	{
		ConfigReader MyConf(ServerInstance);

		FantasyCommands.clear();
		FantasyMap.clear();
		for (int i = 0; i < MyConf.Enumerate("fcommand"); i++)
		{
			FantasyCommand a;
			std::string txt;
			txt = MyConf.ReadValue("fcommand", "text", i);
			std::transform(txt.begin(), txt.end(), txt.begin(), ::toupper);
			a.text = txt.c_str();
			a.replace_with = MyConf.ReadValue("fcommand", "replace", i, true);
			a.operonly = MyConf.ReadFlag("fcommand", "operonly", i);
			a.format = MyConf.ReadValue("fcommand", "format", i);
			a.case_sensitive = MyConf.ReadFlag("fcommands", "matchcase", i);
			FantasyCommands.push_back(a);
			FantasyMap[txt] = 1;
		}
	}