Beispiel #1
0
void LoadSettings()
{
	returncode = DEFAULT_RETURNCODE;

	string File_FLHook = "..\\exe\\flhook_plugins\\changesys.cfg";
	int iLoaded = 0;

	INI_Reader ini;
	if (ini.open(File_FLHook.c_str(), false))
	{
		while (ini.read_header())
		{
			if (ini.is_header("config"))
			{
				while (ini.read_value())
				{
					if (ini.is_value("enabled"))
					{
						bPluginEnabled = ini.get_value_bool(0);
					}
				}
			}
			if (ini.is_header("AllowedSystems"))
			{
				while (ini.read_value())
				{
					if (ini.is_value("sys"))
					{
						bPluginAllowedSystems.push_back(ini.get_value_string(0));
					}
					if (ini.is_value("desc"))
					{
						bPluginAllowedSystemsFriendly = ini.get_value_string();
					}
				}
			}
		}
		ini.close();
	}

	ConPrint(L"ChangeSys: Loaded\n", iLoaded);
}
Beispiel #2
0
void LoadSettings()
{
	returncode = DEFAULT_RETURNCODE;

	string File_FLHook = "..\\exe\\flhook_plugins\\bountytracker.cfg";
	string File_FLHook_bounties = "..\\exe\\flhook_plugins\\bountytrackerbounties.cfg";
	int iLoaded = 0;

	INI_Reader ini;
	if (ini.open(File_FLHook.c_str(), false))
	{
		while (ini.read_header())
		{
			if (ini.is_header("config"))
			{
				while (ini.read_value())
				{
					if (ini.is_value("enabled"))
					{
						bPluginEnabled = ini.get_value_bool(0);
					}
					if (ini.is_value("CleanInterval"))
					{
						iCleanInterval = ini.get_value_int(0);
						conDebug(L"cleaning interval set to " + stows(itos(iCleanInterval)));
					}
					if (ini.is_value("BountyAge"))
					{
						iBountyAge = ini.get_value_int(0);
						conDebug(L"bounty age set to " + stows(itos(iBountyAge)));
						
					}
				}
			}
		}ini.close();
	}
	if (ini.open(File_FLHook_bounties.c_str(), false))
	{
		while (ini.read_header())
		{
			if (ini.is_header("bounty"))
			{
				while (ini.read_value())
				{
					if (ini.is_value("hit"))
					{
						string setTargetName = ini.get_value_string(0);
						wstring theTargetName = ToLower(stows(setTargetName));
						BTI.Char = ToLower(ini.get_value_string(0));
						BTI.Cash = ini.get_value_string(1);
						BTI.xTimes = ini.get_value_string(2);
						BTI.issuer = ToLower(ini.get_value_string(3));
						BTI.active = ini.get_value_bool(4);
						BTI.lastIssuer = ToLower(ini.get_value_string(5));
						BTI.lastTime = ini.get_value_string(6);
						BTI.issueTime = ini.get_value_string(7);
						mapBountyTargets[theTargetName] = BTI;
						++iLoaded;
					}
				}
			}
		}
		ini.close();
	}

	ConPrint(L"BOUNTYTRACKER: Loaded %u Bounties\n", iLoaded);
}